Hi, I'd like to say something on the listener topic masukomi mentioned here.
I think he is wrong with his opinion with Actions meryly acting as ActionListeners.
Actions in the context of JMenuItem, JButton, (in fact, all descendants of AbstractButton) define the name, the icon, the tooltip, the shortcut keys, the mnemonic of the AbstractButton (ie JMenuItem, ...). So, if you create e.g. a JMenuItem from a Action, you do not neet to specify Text, Mnemonic and the like for your MenuItem. All this is provided by the Action object you give to JMenuItem(Action).
So, you are able to write a complete application with menus, toolboxes, buttons and whatever without calling any other constructor for JMenuItem, JButton,... than the one with a single Action argument. As I stated out earlier, I just did that a couple of month ago. In the whole application where only about 5 (some old left-over or just too simple to convert them) of menu items not constructed from action objects -- and about 50 actions besides this... These actions where able to change their texts according to the current locale because they registered themself on some locale provider and kept their "enabled" state according to some data source in the application. Because I'm very fond of this, I dare say there is no _need_ of any other constructor for jmenuitem than the one with a action argument. Of course, then there is no need to explicitly set the text, mnemonic ant tooltip for the jmenuitem as well... Change the appropriate attributes of the action object and you are done. The text, tooltip (a bug still in jdk 1.4.1_01 prevents the tooltip from working correctly though), mnemonic, icon (...) of all AbstractButtons (constructed by the action) in your application will change accordingly... But this is my very personal opinion.
I agree with the listener idea, but would also like to have a custom creation there (like the one I implemented for direct constructor arguments like Action for AbstractButton). What about e.g. treeExpansionListenerInitType="com.fancycompany.control.FancyTreeExpansionListner"?
Please do not remove the Action attribute! Frank
