gpt4 book ai didi

java - JMenuItem 和 JMenu 有什么区别

转载 作者:行者123 更新时间:2023-11-30 03:07:33 25 4
gpt4 key购买 nike

JMenuItemJMenu有什么区别?

JMenu m;
JMenuItem i;

最佳答案

一个JMenu是菜单本身,或者如文档所述:

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

一个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/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com