• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

Getting Formatted Content from jEditorPane

 
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 26
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi,

anyone please give some suggestion.
 
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.

 
Marshal
Posts: 80617
469
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

randy ortan wrote:hi,

anyone please give some suggestion.

After less than 3 hours? Patience, patience.
 
prem kanna
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 26
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi,

anyone please give some Suggestion.
 
reply
    Bookmark Topic Watch Topic
  • New Topic