Clear jtextarea first line

How to clear or delete the first line in JTextArea?

I used so far

int start = 0;
                     int end = 131;
                     area.replaceRange (null, start, end);

but it is also deprecated since the JTextArea text method is dynamic, so this is not good.

+5
source share
1 answer

Using:

int end = textArea.getLineEndOffset(0) 
textArea.replaceRange("", 0, end);
+14
source

All Articles