Considerations When Creating a Java Application in a Web Applet

I am trying to turn a Java application into a web applet. For now, I can export the can, sign it, and apparently run it. The Java boot image plays endlessly, and the JFrame application window appears and connects to my application server. Unfortunately, like an applet, JFrame seems to be frozen. It never does anything, and the contents of the window are just the shadows of the frame buffer of the objects moved through it.

The version of the application works fine, and the version of the applet works fine with the Eclipse applet. It is only online that rendering shit. I thought signing the applet would let it work just like the application.

The applet app seems a bit more complicated than I expected. What considerations should be made when performing this conversion?

+4
source share
1 answer

If you see the applet console, you can see an exception there.

You might also want to install an AWT exception handler:

static public final class UncaughtAwtExceptionHandler { public static void installAsUncaughtAwtExceptionHandler() { System.setProperty("sun.awt.exception.handler", UncaughtAwtExceptionHandler.class.getName() ); } public UncaughtAwtExceptionHandler() { /* Nothing to construct */ } public void handle(Throwable ex) { /* Do something here to transmit the exception to your server, or log it, or whatever */ } } 

Since an exception in the AWT thread is probably the cause of your problem, this will give you the opportunity to better understand what the problem is.

+1
source

All Articles