Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

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

 
Anamika Singh
Ranch Hand
Posts: 67
IBM DB2 Java
  • Mark post as helpful
  • send pies
  • 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 .
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!