im stuck on a simple question, i want to display formatted text in a swing control and keep on adding new values into it, i don't want to use .setText(.getText + text)
for personal reasons, (something like the append method for text area is what I am looking for) I've tried JEditorpane, Textpane
but all of them do not have append method. Which swing control should I use?
Add formatted text
70 views Asked by Ajinkya Jumbad At
1
While JEditorPane has no append method, you can certainly add text to its Document via its
insertString(...)
method, and I suggest that you look into doing this.Edit
You ask:
Are you correctly passing in the first parameter, the offset? This should be the length of the current Document.