Reputation:
How do I clean or remove the first line in a JTextArea?
I have used so far
int start = 0;
int end = 131;
area.replaceRange (null, start, end);
but it is also obsolete as a method of JTextArea text is dynamic so this is not good.
Upvotes: 6
Views: 4153
Reputation: 324118
Use:
int end = textArea.getLineEndOffset(0)
textArea.replaceRange("", 0, end);
Upvotes: 16