GeeCON Prague 2014*
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


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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Modify JToolBar buttons and actions