File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Beginning Java and the fly likes event generation Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "event generation" Watch "event generation" New topic

event generation

Rajeev Ravindran
Ranch Hand

Joined: Aug 27, 2002
Posts: 455
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 ??

SCJP, SCWCD, SCBCD, Oracle Certified Professional (SQL n PL/SQL)
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
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

Joined: Jun 09, 2003
Posts: 4632
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
I agree. Here's the link:
subject: event generation
jQuery in Action, 3rd edition