Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
对于一项任务,我要修改现有的 Java 小程序。我试图在我的 JMenuBar 上获得一个 JButton(或可点击的 JMenu)。有几个菜单,其中一个应该可以用作按钮。
我多次发现相同的问题,但获胜的答案表明这将是“坏的”并且仍然应该是 JMenu 中的一个项目。虽然这是一种可能性,但我真的更喜欢其他方式。
谢谢你。
我发现这篇文章(我认为)与您的问题有关:
如何使 JMenu 在 JMenuBar 中具有 Button 行为
这是您要完成的任务吗?
祝你好运!