Not sure what I understand, I assume that TextArea means that JTextArea and MainClass are the entry point of the application.
What is stopping you from doing this like that?
public class Updater implements Runnable {
private JTextArea textArea;
public Updater(JTextArea textArea){
this.textArea = textArea;
}
@Override
public void run(){
SwingUtilities.invokeLater(new Runnable(){
public void run(){
textArea.setText("New Text");
}
});
}
}
And in your "MainClass" something like this:
public static void main(String[] args) {
Thread myThread = new Thread(new Updater(myTextArea));
myThread.start();
}
source
share