I am trying to sut this game up so that if the text "NateTheWizard" are typed in a text field, then the 'new game' button will load level 3 instead of level one.
With this text, no matter what is in the field, it loads level one:
public void startButton_actionPerformed(ActionEvent e) {
if((password.getText() == "NateTheWizard")){
DotStealthFrame.contentPane.removeAll();
DotStealthFrame.contentPane.add(new Level3(), BorderLayout.CENTER);
DotStealthFrame.contentPane.updateUI();
DotStealthFrame.contentPane.getComponent(0).requestFocusInWindow();
lvl3Popup level3Pop = new lvl3Popup();
level3Pop.setModal(false);
level3Pop.setLocation(300, 300);
level3Pop.setVisible(true);
}
else{
DotStealthFrame.contentPane.removeAll();
DotStealthFrame.contentPane.add(new Level1(), BorderLayout.CENTER);
DotStealthFrame.contentPane.updateUI();
DotStealthFrame.contentPane.getComponent(0).requestFocusInWindow();
lvl1Popup level1Pop = new lvl1Popup();
level1Pop.setModal(false);
level1Pop.setLocation(300, 300);
level1Pop.setVisible(true);
};
}