• Post Reply Bookmark Topic Watch Topic
  • New Topic

how to inherit actionEvent?  RSS feed

 
Kay Tracid
Ranch Hand
Posts: 148
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I have a class (Jpanel) with some graphic components (buttons ...). In addition to this I have another class that inherits form my first class. Now I want to catch actionEvents from the components of my first class in the second class. How can I do this?
Please helph!
Thanks a lot!
 
Kay Tracid
Ranch Hand
Posts: 148
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
abstract is the solution!
My first class must be abstract, and the actionPerformed too.
 
expired user
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You need to pass the class as an argumnet to the class where you want to handle the event.
If you pass the class' object in the addActionListener()you can handle the events as soon as it had occured.
 
Kay Tracid
Ranch Hand
Posts: 148
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
but i cant add an actionlistener to a panel
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!