This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Swing / AWT / SWT and the fly likes Getting Formatted Content from jEditorPane Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Getting Formatted Content from jEditorPane" Watch "Getting Formatted Content from jEditorPane" New topic
Author

Getting Formatted Content from jEditorPane

prem kanna
Greenhorn

Joined: Sep 10, 2008
Posts: 26
When formatted text is placed in jEditorPane, it has to be fetched and displayed in web page with the same format.

Is there any feature available to enable html oriented formatted content can be fetched from jEditorPane?

For eg,


• Content1
• Content2
• Content3

This is for testing.


If above text is placed in jEditorPane and if it’s content are fetched, it should be like


  • Content1

  • Content2

  • Content3




This is for testing.


When I pasted the below mentioned content in JEditorPane,

• Content1
• Content2
• Content3

This is for testing.

I got the output text From JEditorPane as follows:

<html>
<head>

</head>
<body>
• Content1 • Content2 • Content3 This is for testing.
</body>
</html>
But I need to get the output as exact html formatted content for the input pasted in JEditorPane. When a text with different colors is pasted, it is not taking up the font format and it is showing in normal font color.


Is there any way available to get formatted content from jEditorPane or some other swing control as mentioned above?


Thanks in advance
prem kanna
Greenhorn

Joined: Sep 10, 2008
Posts: 26
hi,

anyone please give some suggestion.
eric aro
Greenhorn

Joined: Dec 04, 2009
Posts: 15
hi,

It's not very clear to me, but as far as I've understand, you should just consider settings the "contentType" attribute of you editorPane to "text/html" and that will do it.

But, as far as I know, editorpane is a little buggy, with respect to copy paste, and lists... (it add useless extraneous space).

But, again, this might not be your question.

Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 38057
    
  22
randy ortan wrote:hi,

anyone please give some suggestion.
After less than 3 hours? Patience, patience.
prem kanna
Greenhorn

Joined: Sep 10, 2008
Posts: 26
hi,

I have already set contentType as "text/html", then only i got the answer above mentioned like that. When I posted the query to this site with my output it was converted into Original format. So please refer below link to see my Original post
http://forums.about.com/n/pfx/forum.aspx?msg=2382.1&nav=messages&webtag=ab-java

i will explain my requirement in detail.

My GUI consists of a jEditorPane in which the user will paste the formatted text from MS word or some other application (formatted text contains->un ordered list contents, bold text, italic texts, underlined text, etc). While user clicks the button, one auto mail is generated in which the formatted content is gathered from jEditorPane and the given user’s information is stored into string variable and it will be included into the mail.

When I fetch the contents from jEditorPane, it won’t retrieve full set of contents and also it won’t allow to paste the formatted text like bolded text, color changed texts, underlined text are not allowed.

I need to know which swing control I can use to meet my requirement as specified. Please educate me how to proceed in this case.

Many Thanks in advance
prem kanna
Greenhorn

Joined: Sep 10, 2008
Posts: 26
hi,

anyone please give some Suggestion.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Getting Formatted Content from jEditorPane
 
Similar Threads
My first webservice call
CSS navigation Menu
Problem with struts-menu for second level submenu
Struts tag to print html
XML Tranformation using XSLT