What is the difference between JMenuItem and JMenu?
JMenu m;
JMenuItem i;
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 theJMenuBar.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With