Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

problem with implementing Action Listener, cannot find symbol addActionListener...

 
cypher kronis
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
this is my full code:



as you can see its quite short, and i import awt events, which i think is where action listener is. i make sure to implement it ( and that works fine ) the error comes when i try to call addActionListener(this) in the constructor. can anyone see whats up? thanks for your help..
 
Pat Hays
Ranch Hand
Posts: 138
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi cypher

The cause is that JPanel does not have addActionListener method. So you can not add a ActionListener to your JPanel.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!