Re: JEditorPane, How to get HTML
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
Bernie Hunt wrote:
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
.
Relevant Pages
- Re: Parse HTML DOM document in console application
... I have made a simple console app that demonstrates the loading of HTML from ... > but was unable to make the solution by Charles Law work on my m/c (I have ... (microsoft.public.dotnet.languages.vb) - Hosting WebBrowser control and provide custom scripting objects *during* document loading
... In my HTML pages I want to use certain custom JScript objects *during* the loading of the webpage. ... In my HTML page I have script that gets executed on the "onload" event and needs some variables to operate with. ... Could I hook up with the NavigateComplete2 event instead and inject my named objects using ... (microsoft.public.inetsdk.programming.webbrowser_ctl) - Re: background flicker
... The HTML is stored locally on the disk... ... the background drawn WHILE the flash content is being loaded (therefore, ... the framework is busy loading the HTML before OnEraseBkgnd gets a chance to ... But then, if this is the case, I shouldn't see the window ... (microsoft.public.vc.mfc) - Ie6 password input problem
... This is about IE6 crashing after loading an html ... page with a password input field with a value=" " option containing ... (Vuln-Dev) - Re: Removing alerts from WebBrowser control
... How are you loading the HTML? ... If you are loading it from a file, I would modify the contents of the ... control in DocumentCompleted event? ... (microsoft.public.dotnet.languages.csharp) |
|