I currently use this class to put text into a 'log' JTextArea
:
public void appendOutput(String output) {
textPane.setText(textPane.getText() + "\n " + output);
}
This works pretty well except for the fact that a text wrapping JTextArea
will cut words in half. Is there a good/easy fix for this?
JTextArea.setWrapStyleWord(true)
So in your case it would be:
textPane.setWrapStyleWord(true);