• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Listeners

 
Sagar Dabas
Ranch Hand
Posts: 47
C++ Java PHP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Does event sources are registered with only one object of a listener? No new listener's object is created every time when a user clicks a button.

This program appends the string with a new incremented character when user clicks on the button.
'build' is the instance variable of the listener class. 'build' remembers its previous value and appends the new value when user clicks the button that means no new listener object is created. Only the function actionPerformed() is invoked on the same object..

Am I correct ?

 
Campbell Ritchie
Sheriff
Pie
Posts: 50196
79
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, I think you are correct.
I quite enjoyed running your little application with abcde
 
Sagar Dabas
Ranch Hand
Posts: 47
C++ Java PHP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks....
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic