So let's say hypothetically I have a JEditorPane.
I also have a void called addText(String S) which goes like this
public void addText(String s)
jeditorpane.setText(jeditorpane.getText() + s);
}
Now I will have a button and when pressed reads all the lines of a text file and writes them into the text editor box using a buffered reader and adding text line by line.
Why is it that when the button is pressed the application will freeze for a couple seconds then have everything posted on at once. Is their a way so you see everything posting dynamically and seeing itbeing posted one by one. That is how the code is written.
I have some sources from StackOverFlow that may help you: