I am not sure how to make this all work together but I am supposed to make the text field display the text typed but only when we press submit. It is supposed to display the text in the console. So I need some help adding onto this to finish the code.
    import java.awt.*;
    import javax.swing.*;
    public class testExample1 extends JFrame {
      JTextField textField1;
      JButton mybutton;
    public testExample1() {
      setSize(300, 100);
      setTitle("Text Action");
      setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
      setLayout(new FlowLayout());
    
      textField1 = new JTextField(10);
      mybutton = new JButton("Submit");
    
      add(textField1);
      add(mybutton);
    
      setVisible(true);
     
      System.out.println()
   }
    public static void main(String args[]) {
          new testExample1();
  }
}
 
     
    