• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • paul wheaton
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
  • Himai Minh
Bartenders:

Any way to know when frame/components ready for showing?

 
Ranch Hand
Posts: 585
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have an app that takes a bit to load the components before they can be shown. So I want to show a splash screen beforehand. The problem is I've been estimating how long it takes to load all the components, and showing the splash screen for that time. But of course, this time is different on every computer. Is there any way (listeners?) to be notified when a frame is ready to be visible? (and when its components are ready too?)
 
Robert Paris
Ranch Hand
Posts: 585
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
anyone?
 
Ranch Hand
Posts: 299
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Off the top of my head...heare's one way to do it....
WhHen your app starts up, display a "Please wait" type dialog - maybe even kick off a thread and use a progress bar that just goes back and forth. Now start your other initialization stuff and as soon as it's done, hide the please wait dialog and show your new window.
Brian
 
Robert Paris
Ranch Hand
Posts: 585
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think you misunderstood my question. My question is: how do I know when the loading of Swing components is done? When I create a JFrame and all it's components and set it visible, it's not instantaneous - it takes a few seconds for the JVM to map everything to native screen resoueces. So for that time, nothing is on the screen. I want to know, how can I be notified of "everything is now mapped to native screen resources and will appear on screen."
 
reply
    Bookmark Topic Watch Topic
  • New Topic