JMenuitem onClick action

Questions, answers, tips and ideas on Servoy Client

JMenuitem onClick action

Postby tcOng » Thu Oct 15, 2009 3:32 am

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
tcOng
 

Re: JMenuitem onClick action

Postby ROCLASI » Thu Oct 15, 2009 8:28 am

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.
Robert Ivens
SAN Developer / Servoy Valued Professional / Servoy Certified Developer

ROCLASI Software Solutions / JBS Group, Partner
Mastodon: @roclasi
--
ServoyForge - Building Open Source Software.
PostgreSQL - The world's most advanced open source database.
User avatar
ROCLASI
Servoy Expert
 
Posts: 5438
Joined: Thu Oct 02, 2003 9:49 am
Location: Netherlands/Belgium


Return to Servoy Client

Who is online

Users browsing this forum: No registered users and 7 guests