27.04.2013 Views

330 Java Tips.pdf - FTP Server

330 Java Tips.pdf - FTP Server

330 Java Tips.pdf - FTP Server

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Applets<br />

//////////////////////////////////////////////////////<br />

and the HTML needs to have MAYSCRIPT enabled.<br />

//////////////////////////////////////////////////////<br />

<br />

<br />

Integre Technical Publishing<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

//////////////////////////////////////////////////////<br />

Here's the API:<br />

<br />

It's small enough that you could include it in your JAR if you'd like. But most users will even have it on<br />

their systems.<br />

It says "Netscape," but I know that IE understands it fine.<br />

--<br />

Greg Faron<br />

Integre Technical Publishing<br />

Q: Is it possible to run an Applet inside a JAVA application?<br />

Answer: An applet is just another class that can be instantiated:<br />

Applet myApplet = new MyApplet();<br />

where MyApplet is the name of the applet class that you have written and then added to a container of<br />

some kind<br />

myFrame.add(myApplet);<br />

..but you need explicitly call the init() method that a browser would normally call "behind the scenes":<br />

myApplet.init();<br />

-artntek<br />

file:///F|/350_t/350_tips/applets.htm (9 of 10) [2002-02-27 21:17:49]

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!