UI用にこのクラスがあります
public class MyFrame extends JFrame{
   JTextArea textArea;
  public MyFrame(){
   setSize(100,100);
   textArea = new JTextArea(50,50);
   Container content = getContentPane(); 
   content.add(textArea);
  }
 public static void main(String[] args){
          JFrame frame = new MyFrame();  
          frame.show();
          UpdateText u = new UpdateText();
          u.settext("Helloworld");
      }
}
のテキストを設定するこの別のクラスがあります。このクラスでは、textArea別のクラスの textArea にアクセスするために MyFrame を拡張しました。
public class UpdateText extends MyFrame{
    public void settext(String msg){
     textArea.setText(msg);
    }
}
次に、UpdateText をインスタンス化し、関数 settext を呼び出します。テキストは GUI に表示されないようです。