*
The moose likes Applets and the fly likes Applet Loading Too Long Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Applets
Bookmark "Applet Loading Too Long" Watch "Applet Loading Too Long" New topic
Author

Applet Loading Too Long

Ethan Moises
Greenhorn

Joined: Aug 16, 2010
Posts: 1
Hi,

I have an applet with very huge data to load. What should be the best way such that
the user wouldnt see a blank page for too long. Any help is appreciated.

Thanks
Lester Burnham
Rancher

Joined: Oct 14, 2008
Posts: 1337
Write the applet in such a way that the GUI is not dependent on all the data being loaded. Then you can construct and show it the UI while you're downloading all the data in a background thread.
Mike Pukuotukas
Greenhorn

Joined: Oct 08, 2010
Posts: 6
You need to start a separate thread that loads file from the server (also unsigned applets can do this, place the file in the same folder where the applet is on the server). The applet Swing thread must start the loading thread, and when the loading thread completes it can call SwingUtils.invokeLater( ... ) to apply any changes in the Swing GUI (do not call Swing methods from the non-Swing thread directly, may hang). You can also use this approach to update control like progress bar in Swing that it could show the real progress of loading.
 
GeeCON Prague 2014
 
subject: Applet Loading Too Long