JTextArea nie wyświetla tekstu

W mojej funkcji wyświetlania tekstu w polu tekstowym napisałem następujące wiersze kodu, ale nie wyświetla on żadnego tekstu

        jTextArea1.setText( Packet +"\n" +jTextArea1.getText());

Używam swingworkera do wykonywania zadań w tle, oto mój kod

public class SaveTraffic extends SwingWorker<Void, Void> {


public GUI f = new GUI();

@Override
public Void doInBackground() throws IOException {
              //some code
              sendPacket(captor.getPacket().toString()); 
              return null;
             }//end main function

@Override
public void done() {
    System.out.println("I am DONE");

}


public void sendPacket(String Packet) {

 f.showPackets(Packet);
}

}

oraz następujące linie kodu, które napisałem w formularzu GUI

 public  void showPackets(String Packet) {

 jTextArea1.append( Packet);

}

Rozwiązanie: publiczna klasa SaveTraffic rozszerza SwingWorker {

     public GUI f = new GUI();

     @Override
    public Void doInBackground() throws IOException {
    f.add(jTextPane1);
   // some code

   publish(captor.getPacket().toString());

   // the method below is calling sendPacket on the background thread
   // which then calls showPackets on the background thread
   // which then appends text into the JTextArea on the background thread
  //sendPacket(captor.getPacket().toString());

    return null;
   }

  @Override
   protected void process(List<String> chunks) {
   for (String text : chunks) {
     jTextPane1.setText(text);
     f.showPackets(text);
   }
  }

  @Override
  public void done() {
   System.out.println("I am DONE");

   }

}

questionAnswers(3)

yourAnswerToTheQuestion