I have a problem with my text area.
I use jTextArea1.append(\"cleverly amusing\");
to add the text..
FIRST APPEND:
Why not use setText(String text)
instead of append(String text)
?
Instead of removeAll
, just call setText()
with the first line you want and then you can append the additional data if you want.
If your JTextArea will only contain "WORD HINT: ..." then use the setText() method:
jTextArea1.setText("WORD HINT:\n" + word);
This will replace all the text with what you want.
BTW : removeAll() is part of the Container class, and is not to remove text but child components.