User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the Java section within the Software Development category of DaniWeb, a massive community of 423,640 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,173 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Java advertiser: Lunarpages Java Web Hosting
Views: 578 | Replies: 2
Reply
Join Date: May 2008
Posts: 12
Reputation: regent_royal is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
regent_royal's Avatar
regent_royal regent_royal is offline Offline
Newbie Poster

displaying HTML Text into the jEditorPane in swing

  #1  
Jul 4th, 2008
Hi, friends
I am developing project in which I get some data from the database which is already saved as HTML. I can get get whole data which is simple HTML but this database content is developed as below.

Word file first created save it as the web content and this text web content saved into the database. which is some what like below.

<html xmlns:o="urn:schemas-microsoft-com:office:office"
xmlns:w="urn:schemas-microsoft-com:office:word"
xmlns="http://www.w3.org/TR/REC-html40">

<head>
<meta http-equiv=Content-Type content="text/html; charset=windows-1252">
<meta name=ProgId content=Word.Document>
<meta name=Generator content="Microsoft Word 11">
<meta name=Originator content="Microsoft Word 11">
<link rel=File-List href="curent%20data_files/filelist.xml">
<title>Hi friends How r u</title>
<!--[if gte mso 9]><xml>
<oocumentProperties>
<o:Author>regent3</o:Author>
<o:Template>Normal</o:Template>
<o:LastAuthor>regent3</o:LastAuthor>
<o:Revision>2</o:Revision>
<o:TotalTime>2</o:TotalTime>
<o:Created>2007-06-02T23:46:00Z</o:Created>
<o:LastSaved>2007-06-02T23:46:00Z</o:LastSaved>
<oages>1</oages>
<o:Words>6</o:Words>
<o:Characters>36</o:Characters>
<o:Company>regentdatatech</o:Company>
<o:Lines>1</o:Lines>
<oaragraphs>1</oaragraphs>
<o:CharactersWithSpaces>41</o:CharactersWithSpaces>
<o:Version>11.5606</o:Version>
</oocumentProperties>
</xml><![endif]--><!--[if gte mso 9]><xml>
<w:WordDocument>
<wpellingState>Clean</wpellingState>
<w:GrammarState>Clean</w:GrammarState>
<wunctuationKerning/>
<w:ValidateAgainstSchemas/>
<waveIfXMLInvalid>false</waveIfXMLInvalid>
<w:IgnoreMixedContent>false</w:IgnoreMixedContent>
<w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText>
<w:Compatibility>
<w:BreakWrappedTables/>
<wnapToGridInCell/>
<w:WrapTextWithPunct/>
<w:UseAsianBreakRules/>
<wontGrowAutofit/>
</w:Compatibility>
<w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel>
</w:WordDocument>
</xml><![endif]--><!--[if gte mso 9]><xml>
<w:LatentStyles DefLockedState="false" LatentStyleCount="156">
</w:LatentStyles>
</xml><![endif]-->
<style>
<!--
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{mso-style-parent:"";
margin:0in;
margin-bottom:.0001pt;
mso-pagination:widow-orphan;
font-size:12.0pt;
font-family:"Times New Roman";
mso-fareast-font-family:"Times New Roman";}
@page Section1
{size:8.5in 11.0in;
margin:1.0in 1.25in 1.0in 1.25in;
mso-header-margin:.5in;
mso-footer-margin:.5in;
mso-paper-source:0;}
div.Section1
{pageection1;}
-->
</style>
<!--[if gte mso 10]>
<style>
/* Style Definitions */
table.MsoNormalTable
{mso-style-name:"Table Normal";
mso-tstyle-rowband-size:0;
mso-tstyle-colband-size:0;
mso-style-noshow:yes;
mso-style-parent:"";
mso-padding-alt:0in 5.4pt 0in 5.4pt;
mso-para-margin:0in;
mso-para-margin-bottom:.0001pt;
mso-pagination:widow-orphan;
font-size:10.0pt;
font-family:"Times New Roman";
mso-ansi-language:#0400;
mso-fareast-language:#0400;
mso-bidi-language:#0400;}
</style>
<![endif]-->
</head>

<body lang=EN-US style='tab-interval:.5in'>

<div class=Section1>

<p class=MsoNormal>Hi friends How r u.</p>

<p class=MsoNormal>That is the example..</p>

</div>

</body>

</html>


IN THIS WHOLE CONTENT i have just write two sentence..
This code is generated by MS WORD...

Thanks in advance..
K etan
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Aug 2007
Location: Adelaide, South Australia
Posts: 381
Reputation: darkagn will become famous soon enough darkagn will become famous soon enough 
Rep Power: 3
Solved Threads: 43
darkagn's Avatar
darkagn darkagn is offline Offline
Posting Whiz

Re: displaying HTML Text into the jEditorPane in swing

  #2  
Jul 4th, 2008
I'm sorry regent_royal, what was the question? If you want to know how to display that HTML that you have posted in a JEditorPane its just a matter of assigning all of that HTML text via a call to the component's setText() method.
The answer is 42.
Reply With Quote  
Join Date: May 2007
Location: USA
Posts: 2,826
Reputation: Ezzaral is a name known to all Ezzaral is a name known to all Ezzaral is a name known to all Ezzaral is a name known to all Ezzaral is a name known to all Ezzaral is a name known to all 
Rep Power: 12
Solved Threads: 282
Featured Poster
Ezzaral's Avatar
Ezzaral Ezzaral is offline Offline
Posting Maven

Re: displaying HTML Text into the jEditorPane in swing

  #3  
Jul 4th, 2008
Though most of it probably won't get parsed and there is no telling how it will display. The HTMLEditorKit which does the rendering for Swing components is pretty simplistic and limited in it's capabilities.
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb Java Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Other Threads in the Java Forum

All times are GMT -4. The time now is 10:19 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC