import java.awt.FlowLayout; import java.awt.event.ActionListener; import java.awt.event.ActionEvent; import javax.swing.JFrame; import javax.swing.JTextField; import javax.swing.JPasswordField; import javax.swing.JOptionPane; import javax.swing.JLabel; /** A simple JFrame---similar to the one presented in the YouTube video "Java Programming Tutorial-52 Event Handling by YouTube user "thenewboston". This class corresponds to the tuna class from the video. (http://www.youtube.com/watch?v=3EE7E3bvfe8) @author Youtube user "thenewboston" @author Phill Conrad @see Youtube Link */ public class MyJFrame extends JFrame { private JLabel theLabel; private JTextField jtf1; private JTextField jtf2; private JTextField jtf3; public MyJFrame() { super("My Window Title"); // superclass constructor sets the title setLayout(new FlowLayout()); // default layout theLabel = new JLabel("This is my JFrame"); theLabel.setToolTipText("What up, Santa Barbara!?"); add(theLabel); jtf1 = new JTextField(10); add(jtf1); jtf2 = new JTextField("default text"); add(jtf2); jtf3 = new JTextField("uneditable"); jtf3.setEditable(false); add(jtf3); } }