I make a Java application in NetBeans. It is necessary to output certain data obtained in the course of the program in the jTextArea
field.
There is a main class A (with the main method), in which several buttons and one text field jTextArea
created using the visual editor. By clicking on the button, one of the methods of class B is called, which performs certain actions and gives several results in the form of strings along the way.
It is necessary to display these results in jTextArea. Tried to do so A.jTextArea1.append("\nзначение");
But the problem is that the values in jTextArea1
appear only after ALL actions in class B are completed (and the program returns to class A). This is logical, but I need to display the values in jTextArea in real time, i.e. as soon as they appear.
How to implement it? I would be grateful for the help, or for the link to the explanatory material on this issue.