I have a program that Has several buttons on a JFrame to start with. I want one of them to open another JFrame with a JTextField. The first "click to start" button calls two methods that work well. But I'm not sure how to create the second frame with the textfield for the login to vote button.
My code right now is this.
public class event implements ActionListener {
public void actionPerformed(ActionEvent e) {
String command = e.getActionCommand();
if (command.equals("Click to Start")) {
createBeginWindow();
panelAdder();
} else if (command.equals("Login to Vote")) {
//This is where I want to create the JFrame. VoterID would be what is written in the JTextField.
String voterID = (_text.getText());
//And then I would use this string in other methods
}
}
}