Good example for action listener from oracle... Nice one...
Printable View
Sorry my mistake, the lineQuote:
You said to put the .addActionListener(this) line into the constructor, but when I do that the line is highlighted because the constructor doesn't implement ActionListener,
Add the AnswerBox.addActionListener(this); line to the line after the line which assigns a JTextField to AnswerBox.
Should have said:
Add the AnswerBox.addActionListener(new keyEvents()); line to the line after the line which assigns a JTextField to AnswerBox.