public class HandlerClass1 implements ActionListener { public JTextField tf1; public void actionPerformed (ActionEvent event) { tf1 = new JTextField(""); tf1.setBounds(100, 80,50, 20); add(tf1); } }
What I want the program to do is if a user click the button it will add a new JTextField. My codes return no error or anything. My Program started with no textfield.
I just added a space between the quotation marks and it works