JMenuItem和JMenu有什么区别?
JMenu m;
JMenuItem i;
最佳答案
一个JMenu
是菜单本身,或者如文档所述:
An implementation of a menu -- a popup window containing
JMenuItem
s that is displayed when the user selects an item on theJMenuBar
.
一个JMenuItem
是此类菜单中的单个项目。或者,正如文档所描述的:
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.
关于java - JMenuItem 和 JMenu 有什么区别,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34371711/