Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

what is the difference between JMenuItem and JMenu

Tags:

java

jmenu

What is the difference between JMenuItem and JMenu?

JMenu m;
JMenuItem i;
like image 262
Omar Ǻʟ Zaben Avatar asked Nov 24 '25 13:11

Omar Ǻʟ Zaben


1 Answers

A JMenu is the menu itself, or as the documentation states:

An implementation of a menu -- a popup window containing JMenuItems that is displayed when the user selects an item on the JMenuBar.

A JMenuItem is a single item in such a menu. Or, as the documentation describes it:

An implementation of an item in a menu. A menu item is essentially a button sitting in a list. When the user selects the "button", the action associated with the menu item is performed.

like image 72
Mureinik Avatar answered Nov 27 '25 01:11

Mureinik



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!