473,698 Members | 2,643 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

JEditorPane, How to get HTML

I have a JEditorPane that I'm filling with a webpage using
JEditorPane.set Page(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.get Text();

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
Jan 28 '07 #1
1 8995
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.set Page(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.get Text();

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
Jan 28 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
2401
by: Ahmet Aksoy | last post by:
Hi, I have a JEditorPane. It is filled with some data read from somewhere. While adding new lines, JEditorPane scrolls up. At the end of the action, the last line is at the focus. But, I want the first line to be visble. How can I jump to the first line automatically? Or, is it possible to stop the pane from scrolling while appending new lines? TIA
4
2970
by: Francois Keyeux | last post by:
hello everyone: i have a web site built using vbasic active server scripting running on iis (it works on either iis 50 and 60, but is designed for iis 50) i know how to create a plain text email by creating a text file, with content following certain format, and saving that file into the correct '..\mailroot\pickup' folder, and it is working fine
5
3590
by: serge calderara | last post by:
Dear all, I am new in asp.net and prepare myself for exam I still have dificulties to understand the difference between server control and HTML control. Okey things whcih are clear are the fact that for server control component , code is running on the server side. But if I take as example a Label. I place on a webform an HTM label control and a WebForm label control, I could see that properties are different for
0
3579
by: Ante Sabo | last post by:
Does anyone know of some classes that can act as an HtmlEditorKit replacement which supports html 4. I would like to have some documents to be printed or either saved in html format. I managed to do that but table border are not printed out, and I have not find a way to incorporate JPEG pictures in such printouts, since files should be packaged in jars...
3
2022
by: arivazhaganit | last post by:
while using JEditorPane , I am able to access only file: protocal not http:// protocal , while opening http:// URL in editorpane ,it showing that java.net.ConnectException: Connection timed out: connect ... plz help me
3
3650
by: aryan24 | last post by:
Hi everybod .. as part of my project , i need to call an xml file into an Jeditorpane. I have a button called Load ,when i click on it ,,i need to load the xml file into the JeditorPane...Can any1 plz provide the solution .
1
3007
by: ksr04 | last post by:
Hello Everybody, can anyone tell how to make JEditorPane support CSS??? thanx in advance...
5
3187
by: dunkymunky | last post by:
I've got a JEditorPane that is correctly displaying HTML hyperlinks, but all it does is display them, how can I make it so that when someone clicks on this hyperlink, it opens up their default web browser and opens the correct page? This is the code I have so far: public interface HyperLinkListener { public void hyperlinkUpdate(HyperlinkEvent e); } public void hyperlinkUpdate(HyperlinkEvent evt) { if (evt.getEventType() ==...
1
3336
jhardman
by: jhardman | last post by:
I'm using a JEditorPane to display an HTML-formatted page. When I make changes to the page, I find I can't see the changes unless I compile a new java file and point to a new HTML file, as if the old page is cached somewhere. Is there any easier way to refresh the HTML page I'm seeing, or is there something obvious I'm missing? Jared
0
8611
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9170
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9031
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8904
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8876
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6531
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4372
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4624
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2341
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.