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

October 2014

S M T W T F S
   1 2 34
567891011
12131415161718
19202122232425
262728293031 

Recent Entries

Search My Blog

0 user(s) viewing

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

Categories