I have a JEditorPane that I'm filling with a webpage using
JEditorPane.setPage(www.something.com) and it is working fine.
My problem is I want to save the HTML from the page displayed into a
string. I've tried;
String tempString = new String();
tempString = JEditorPane.getText();
This gives me the html for a blank web page.
How can I read the HTML from the page that is displayed in the JEditorPane?
Thanks,
Bernie
Bernie Hunt - 28 Jan 2007 17:04 GMT
I found the answer. Loading the page with getPage works asyncrounously
so reading the text from the EditorPane may not be valid if the page is
not completed loading. If you set the document to be syncronous, then
the problem goes away.
Bernie
> I have a JEditorPane that I'm filling with a webpage using
> JEditorPane.setPage(www.something.com) and it is working fine.
[quoted text clipped - 11 lines]
> Thanks,
> Bernie