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

event generation

 
Rajeev Ravindran
Ranch Hand
Posts: 455
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi all,
can we progammatically invoke the event of a button ?? i mean, without implementing the ActionListner interface is it possible to invoke the event of a button using jdk1.2 or higher ??
thanks
raj.
 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
you can use this from api:
fireActionPerformed protected void fireActionPerformed(ActionEvent event)

Notifies all listeners that have registered interest for notification on this event type. The event instance is lazily created using the parameters passed into the fire method.

but you need to implement your listener !!!
[ June 30, 2003: Message edited by: Benjamin Leonard ]
 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Another option might be to move the ActionPerformed task into a separate function. The function is then able to be called from elsewhere in the code.
instead of this

something like this
 
girl power ... turns out to be about a hundred watts. But they seriuosly don't like being connected to the grid. Tiny ad:
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!