• 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

How do I know if my JEditorPane has retrived all the contents of a URL?

 
Ranch Hand
Posts: 67
IBM DB2 Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I want to place all the contents of a URL into a JEditorPane using the setPage("http://www.javaranch.com").This takes some time while the next line of code executes .In this next line I calculate the height of the JEditorPane using JEditorPane.getBounds().getHeight()
The culprit lies here. As the page takes time to load and execution jumps to the next line I always get pageHeight as 0.0
I want the page to load completely and then the height to be calculated.How can I achieve this??Use threads or there is some method which tells me when the loading from a URL is complete .
 
If you settle for what they are giving you, you deserve what you get. Fight for this tiny ad!
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic