How can i remove lines from a JTextArea one by one instead of all together?
I have a JTextArea which gets appended with string results from a thread, now i would like to remove one line at a time while the thread is executing.
javax.swing.text.Utilities
class can help you find out the start and finish location of every line of text in your JTextArea.Edit
You ask:
the main concern is about how to remove it from the JTextArea, i have already calculated the start and end positions of a line that has to be deleted.But what function can assist in removing just that one line?
getDocument()
remove(int offs, int length)
on the Document as per the Document API.