Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / January 2007

Tip: Looking for answers? Try searching our database.

JEditorPane, How to get HTML

Thread view: 
Bernie Hunt - 28 Jan 2007 14:31 GMT
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


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.