Win a copy of 97 Things Every Java Programmer Should Know this week in the Java in General forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
  • Piet Souris
  • salvin francis
  • fred rosenberger

Applet Loading Too Long

Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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.

Posts: 1337
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
You guys haven't done this much, have ya? I suggest you study this tiny ad:
Devious Experiments for a Truly Passive Greenhouse!
    Bookmark Topic Watch Topic
  • New Topic