File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Swing / AWT / SWT and the fly likes Question about doClick( ) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Question about doClick( )" Watch "Question about doClick( )" New topic

Question about doClick( )

Hussein Baghdadi
clojure forum advocate

Joined: Nov 08, 2003
Posts: 3476

Hey ranchers.
I have read the following about doClick( ) method :
Programmatically perform a "click". This does the same thing as if the user had pressed and released the button
does that mean that I can use doClick( ) instead of :
button.addActionListener(new ActionListener( )) approach ?
Craig Wood
Ranch Hand

Joined: Jan 14, 2004
Posts: 1535
The doClick methods in the AbstractButton api are a way to programmatically generate an ActionEvent from a JButton. The JButton still needs an ActionListener to receive the event that is generated.
I agree. Here's the link:
subject: Question about doClick( )
Similar Threads
How to trigger a mouse event with out MouseListener
how to fire event automatically
Create an Action
Manually sending events?
JMenuBar Rollover