File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Swing / AWT / SWT and the fly likes Modify JToolBar buttons and actions Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Modify JToolBar buttons and actions" Watch "Modify JToolBar buttons and actions" New topic
Author

Modify JToolBar buttons and actions

Vladislav Semenov
Greenhorn

Joined: Mar 01, 2004
Posts: 5
How can I change the Action of JButton if I have JToolBar instance?
Rachel Swailes
Ranch Hand

Joined: May 18, 2004
Posts: 434
You have a JButton in a JToolBar. Regardless of where the JButton is, you can give it an action listener with myButton.addActionListener and then in the action listener you tell the application what to do when the button is pressed.

Is that what you mean by change the action?

Cheers,
Rachel
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Modify JToolBar buttons and actions
 
Similar Threads
Keyboard Navigation
Update GUI In Realtime
JToolBar
Separator in JToolBar
JToolBar in applet