Subscribe to Tethik's Blag        RSS Feed
- - - - -

How to append to a HTML JEditorPane

Icon Leave Comment
Let's say we wanted to append a String "text" to a JEditorPane, making sure that any html is parsed:
String text = "<p> Example </p>";

I've found two ways to do it.

The simple but bad way:
JEditorPane pane = new JEditorPane("text/html", null);pane.setText(pane.getText() + text);
...

Page 1 of 1

July 2014

S M T W T F S
  12345
6789101112
13141516171819
20212223 24 2526
2728293031  

Recent Entries

Search My Blog

0 user(s) viewing

0 Guests
0 member(s)
0 anonymous member(s)

Categories