JTextArea - how to clear it?
807597Aug 3 2005 — edited Dec 13 2007Hi!
Could you help me, please?!
I've put some text to a JTextArea. Is it possible to remove it and get an empty box?
Here is my textArea:
textArea = new JTextArea(1, 30);
textArea.setBorder(new TitledBorder(new EtchedBorder(), "Test"));
textArea.setFont(displayFont);
textArea.setBackground(Color.white);
textArea.setEditable(false);
JScrollPane scrollPane = new JScrollPane(textArea);
....then I put some text.........
Here is what I've tried and what did not function:
Textarea.removeAll();
scrollPane.removeAll();
Textarea.remove(0);
scrollPane.remove(0);
Nata