Skip to Main Content

Java SE (Java Platform, Standard Edition)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Create dynamic JMenuItem and handle its action separately

793886Mar 6 2009 — edited Mar 6 2009
Hi all,

I am looking for a help in creating dynamic JMenuItems under JMenu.

I know that through a loop, I can add the JMenuItem under a JMenu. But how can I identify each JMenuItem object so that I can register the listener for each object and handle the action separately, when I click on each JMenuItem.

Any kindly help will be highly appreciated.

Sumode_v
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 3 2009
Added on Mar 6 2009
4 comments
605 views