you should first implement ActionListener to use actionEvent.