• 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
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

How to know when a JFrame and its components are ready?

 
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm creating a browser, with the specific funcionality of search phrases in HTML files. Some files can be very large (10 mb of text - ONLY text). When I open the file, a status bar says: "Opening page: etc, etc, etc". When the reading was finished, it says: "Ready." But this happens when I OPEN the file.

The problem is:
The graphics aren't ready yet. JScrollPane's are processing, JTextPane's are processing, and that message saying: "Ready" while graphics are processing (something that can take a while: 1 or 2 minutes (or even more) to exhibit 900 pages of one single file) is ridiculous.

Is there a listener where I can be informed that the graphic processing is done? So I can enable atcions from user (and print "Ready" in the status bar) after that? And how can I optimize the file-opening and graphic processing?
 
Ranch Hand
Posts: 1535
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You might find some food for thought in these pages of the java tutorial:
How to Use Threads
How to Use Progress Bars
 
I RELEASE YOU! (for now .... ) Feel free to peruse this tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic