• 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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic