I have multiple classes and threads that need to write to a Java Swing JScrollPane. In the Android/Eclipse environment I used android.os.Message. Is there something similar in the NetBeans/Windows environment? Here is where I would like to send the message from:
public class PrintStatusTask extends Thread {
PrintStatusTask(String name) {
this.name = name;
}
private void sendMessage(String s) {
// TODO: send message to jTextArea
}
public void run() {
...
sendMessage("Any message");
...
Here is an example of writing to the JScrollPane from the JFrame it lives in:
public class Controller extends javax.swing.JFrame implements Observer {
...
jTextArea.append(s);
...