Page 1 of 1

JMenuitem onClick action

PostPosted: Thu Oct 15, 2009 3:32 am
by tcOng
I create a form, put it a JMenubar, a JMenu, and a JMenuitem bean.

elements.menubar1.add( elements.menu_File );
elements.menu_File.add( elements.menuitem_New );

I want to execute a form method when click on the menu item. How can I do it :?:

elements.menuitem_New.addMouseListener( ???? ); // or other way

Re: JMenuitem onClick action

PostPosted: Thu Oct 15, 2009 8:28 am
by ROCLASI
Hi,

I suggest you use the menubar plugin instead of the Swing components. The menubar plugin implements them too but it's a lot easier to get these callbacks you want.
In the (example) solutions directory you find a menubar wizard solution that explains how to use it.

Hope this helps.