I am just trying to get a simple password response!!!
I have 3 classes working together.
I am only showing 2 of them. The others just launch classes and make a JFrame.
Am i over complicating this?
Here is code of my start_screen class.
package screen_main; import java.awt.event.*; import javax.swing.*; public class start_screen{ static JButton OK = new JButton("Okay"); static JTextField pass_box = new JTextField(15); static JLabel label = new JLabel("Enter the password: "); public static void run(){ Screen.panel.add(label); Screen.panel.add(pass_box); Screen.panel.add(OK); OK.addActionListener(new ActionListener (){ public void actionPerformed(ActionEvent e) { String pass; pass = pass_box.getText(); pass_box.setText(""); if(pass == "gryff"){ System.out.println("Correct"); }else{ System.out.println("Wrong"); } } }); } }