NetBeans : How to connect two components , so that they perform the same action? -


i have created jmenuitem , jbutton in jform. there easy way connect them perform same action, using netbeans ide? thank you.

use javax.swing.action implement logic (e.g. extending javax.swing.abstractaction) , assign action menu item and button. both have constructor takes action parameter.

enabling/disable action enable/disable button , menu item.

see swing tutorial's chapter using actions more details


Comments

Popular posts from this blog

javascript - backbone.js Collection.add() doesn't `construct` (`initialize`) an object -

php - Get uncommon values from two or more arrays -

Adding duplicate array rows in Php -