Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Can a Single Listener class implements multipls type of Listeners  RSS feed

 
Shaan Shar
Ranch Hand
Posts: 1249
Java Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

The root problem is I am trying to create a single inner class which implements both ActionListner and ChangeListner.

Actually I have used a JButton and JCheckBox both on a single form. And now I want to maintain a single class which implements both above mentioned interfaces. But when I tried to do so it was not listening the ChangeEvent fired by JCheckBox.

Can anybody explain ? If you are not very much clear then do let me know.
 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
works OK for me, although I wouldn't use a changeListener for a checkbox
 
Shaan Shar
Ranch Hand
Posts: 1249
Java Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Michael Dunn:
works OK for me, although I wouldn't use a changeListener for a checkbox


So what would you use for CheckBox instead of ChangeListener ?
Should I post my whole code here to present more clarity.
 
Shaan Shar
Ranch Hand
Posts: 1249
Java Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Michael Dunn:
works OK for me, although I wouldn't use a changeListener for a checkbox


So what would you use for CheckBox instead of ChangeListener ?
Should I post my whole code here to present more clarity.
 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
depends on what you're doing, but normally an actionListener
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!