When I call this method inside class, works. When I call it outside of the class, TextArea doesn't change. While string values are correct.
public void printMessage(String prefix, String message) {
System.out.println(prefix + message); // works
textArea1.setText(textArea1.getText() + prefix + " " + message + "\n"); // works only if called from this class
}
Solved by myself. There was no problem with this code. I didn't initialize instance of this class properly.