This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
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 Android Security Essentials Live Lessons this week in the Android 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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Modify JToolBar buttons and actions
 
Similar Threads
Update GUI In Realtime
JToolBar in applet
Keyboard Navigation
JToolBar
Separator in JToolBar