Skip to main content

JEditorPane - Gettext problems

2 replies [Last post]
machro
Offline
Joined: 2010-10-12

Hi,

I created a JEditorPane using new JEditorPane("text/html", "");

When i use pane.setText("adsf") and then use pane.getText() it returns:

adsf

How can i get the text without those html-tags, but with the htmltext i gave with setText

Is that possible whit HTMLEditorKit?

I hope you understand my question.

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
danca
Offline
Joined: 2010-10-12

Try pane.getDocument().getText(0, pane.getDocument().getLength());

machro
Offline
Joined: 2010-10-12

No, with that code none of my html-tags, wich i use with settext, returns