I am new to Java, so please bear with me. I've tried to get a button to open up a new frame called AboutFrame, but whenever I press the button nothing happens.
I implement the ActionListener first:
class MainFrame extends JFrame implements ActionListener {
Then I set the button (after the usual super("blabla");...)
JButton info = new JButton("About Failsafe");
info.addActionListener(this);
And then:
public void actionPerformed(ActionEvent event) {
String command = event.getSource().toString();
if (command == "info") {
AboutFrame abt = new AboutFrame();
}
}
So what am I doing wrong here? I can't see any mistakes..