简体   繁体   中英

I got problem with replacing jmenubar on jpanel

I am writing a desktop application using java swing with netbeans gui manager. I want replace vertical menu with submenus on Jpanel but when I am putting Jmenubar on Jpanel it does not work. I need some help with this.

A JMenubBar is designed to be added to the JFrame using the setJMenuBar(...) method.

If you want to use popup menus for other Swing components then you should be using a JPopupMenu .

Read the section from the Swing tutorial on How to Use Menus for more information and working examples to get you started.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM