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

Knowing when JTextArea finishes displaying large Document

 
Ranch Hand
Posts: 399
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In order to know when to replace the wait cursor with a normal cursor after doing setDocument() on JTextArea with a large document, I'm looking for a way to tell when JTextArea has presented the document to the user.
My first approach was to do put the code to restore the cursor inside an invokeLater() call after I setDocument(), but I'm not sure this will be dependable. Does anyone know of a way to do that that can be expected to work reliably, or of a different approach to the problem? I'm kind of new to GUI work, and may be missing something obvious.
The program does give the user a way of zeroing in on various interesting parts of the document without working with the whole document in the JTextArea, but the GUI will feel more consistant if the user is allowed select a long section for display in the text area.
The alternative I have, and which I'm beginning to like, is to have the JTextArea display an informative loading message. The loading message stays up after I do the setDocument(), only to be replaced by the large document when it is ready. Is this a standard technique?
 
Your mind is under my control .... your will is now mine .... read this tiny ad
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic