Applets Section Index | Page 18
How do I communicate with an applet from JavaScript?
You can use use JavaScript to diretly call public methods in the applet or access public variables.
JavaScript treats the embedded applet as an object. In the applet tag give the applet
a name (f...more
How can I remove the Microsoft VM from my computer?
Microsoft provides a VM Uninstaller as part of their 4.0 SDK. See http://www.microsoft.com/Java/sdk/40/pg/tools_misctools_2.htm for usage information.more
What JDK version does Internet Explorer support?
You can find this question answered in the Microsoft Knowledge Base at http://support.microsoft.com/support/kb/articles/q214/8/28.asp. Hint, it isn't JDK 1.2.more
How can I get my applets to start up faster when I use Netscape browsers? When I first hit a page with an applet on it I get this "Starting Java..." message that starts up the Java VM on demand, but adds to the applet startup time.
You can have the Java VM initialize itself when the browser starts up by adding the -start_java option to the end of the browser startup command in the startup shortcut/script.
Where does the output from System.out.println(...) go in an applet?
Messages written to standard output (System.out) and standard error (System.err) appear in the Java console of the browser. From Internet Explorer, you can view the console from the View->Java ...more
Can I use menus and a menu bar in an applet?
AWT applets (those that subclass java.applet.Applet) cannot include an AWT MenuBar. Swing applets (those that subclass javax.swing.JApplet) can use the JMenuBar. To display menus in an AWT you wou...more
How can I get the real local host IP address in an applet?
Applet security restrictions do not let you get this in an untrusted applet via InetAddress.getLocalHost().
However, you can get this address by creating a Socket connection back to the web server...more
How can I make my JApplet automatically download the Java Plug-in needed to run Swing applets?
Sun provides an HTML Converter tool (http://java.sun.com/products/plugin/1.2/converter.html) that will setup your web pages to include code that will cause the Java Plug-in to be needed to use the...more
How do I show users with Java disabled what they are missing?
You can place any content you want between the start and end <APPLET> tags. A Java-enabled browser will ignore this content. When Java is disabled, the browser will display the content (othe...more
How do I treat applet parameters as numbers instead of strings, since getParameter() returns a String?
Depending upon which type of number you wish to treat the parameter as, you would need to call the appropriate conversion routine of the corresponding wrapper class. For instance, to treat a Strin...more
I get a ClassCastException when I try to load my applet, what's wrong?
Applets must subclass the java.applet.Applet class (or one of its subclasses like javax.swing.JApplet). If they do not, the browser will not be able to load and start the applet.
I've recompiled my applet and want to use the new version. How do I get the browser to load the new version?
While testing applets, you're better off using appletviewer. As far as browsers go, pressing down the SHIFT or CTRL key when you select Refresh/Reload may cause the browser to load the new vesion....more
What are the main differences between applets and applications?
Applets are created to be embedded within a browser. As such, they have methods that are automatically called by the browser at certain times: init() when first loaded, start() when page loaded/en...more
What System properties are visible from an applet?
You can directly access the following properties from an untrusted Java applet with System.getProperty(name):
java.version
java.vendor
java.vendor.url
java.class.version
os.name
os.version
os.arc...more
When I connect to a URL from my applet, I get a security exception, why?
Untrusted applets are restricted to only communicate back to the host that delivered the applet. You cannot open a connection to any other URL besides the one from which the applet came.