I have a database with a few dozen MB of textual stats.
Applets like this will occasionally fail to print anything (it just hangs):
public class Something extends Applet
{
public void init()
{
System.out.println("hello world");
}
}
If you embed an applet dynamically via DOM, there is a 20% chance of a deadlock. Up on removal from the DOM tree, you get a NullPointerException with a stacktrace pointing to a method that is about to download a JAR.
java.lang.InterruptedException
at java.lang.Object.wait(Native Method)
at java.lang.Object.wait(Object.java:485)
at sun.plugin.ClassLoaderInfo.lock(Unknown Source) <----------------------
at sun.plugin.AppletViewer.loadJarFiles(Unknown Source)
at sun.applet.AppletPanel.runLoader(Unknown Source)
at sun.applet.AppletPanel.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
It can (and will) crash on displaying the JAR loading orange animation.
Exception in thread "Thread-27" java.lang.NullPointerException
at sun.plugin.util.AnimationPanel.createTranslucentImage(Unknown Source)
at sun.plugin.util.AnimationPanel.createGradientShapeImage(Unknown Source)
at sun.plugin.util.AnimationPanel.initBackground(Unknown Source)
at sun.plugin.util.AnimationPanel.preloadResources(Unknown Source)
at sun.plugin.util.AnimationPanel.doPaint(Unknown Source)
at sun.plugin.util.AnimationPanel.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Innocent little Exception on inserting an applet in the DOM tree, in case it is not crashed already. After this the applet runs…
java.lang.NullPointerException
at sun.plugin.AppletViewer.loadJarFiles(Unknown Source)
at sun.applet.AppletPanel.runLoader(Unknown Source)
at sun.applet.AppletPanel.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
It can (and will) throw an AccessControlException in Firefox, on:
public class Somehting extends Applet
{
public void init()
{
Runnable task = new Runnable()
{
public void run()
{
try{ new Socket("my.very.own.host", 80); } catch(IOException exc) { ... }
}
};
new Thread(task).start();
}
}
Except if the FIRST connection made to your own server, is on the EDT. OK?
Then there is the problem that the orange preloader gets stuck at 50%, forever.
Just reload the page, and try again.
And ofcouse the problem that truely nothing happens. The applet is white.
Just reload the page, and try again.
Further, classes don’t truely get unloaded. If you have classes that do a lot of precalculation, like creating a cos/sin lookup table and put it in a static field, and you refresh the page (and thus the applet) 10+ times, memory usage goes up very quickly, eventually slowing down your whole browser due to swapping. You can only restart your browser to get back to normal speed.
Also leaving a page with a super tiny 1x1px applet, only drawing a black pixel, it takes 2 seconds longer than leaving a normal page.
The LiveConnect bugs in FireFox cause your fancy features to either not work at all, or hang your browser.
Loading an applet GRABS FOCUS the hostile way, even if it does not have any ‘input components’. If you were just entering data in a form, or in the address bar, so what, now the applet consumes all your keystrokes, until you click somewhere else. It will even cause to window.toFront on your browser window.
Last but not least, loading an applet freezes your browser for 2-3 seconds, it feels so 1990.
In conclusion:
steer clear of applets if you are doing anything commercially