简体   繁体   中英

Get rid of sub menu in Java Swing using Windows builder

I am trying to learn Java Swing and Windows Builder by creating a personal project. I added a menu bar File, Edit, View, Help etc. When I click on 'File' I get Open,Save,Save As. This is also correct. But using the default options in Windows Builder, Gives me a sub menu under 'Open' indicated by an arrow but I don't want this all I want is:

File - Open - Save - Save As

And I want to get rid of

File - Open ->NULL (this is what comes as default in Windows builder)

You probably added an "Open" JMenu , instead of adding an "Open" JMenuItem . The source code would confirm it.

JMenuItem is a leaf in the menu tree. JMenu is a container for other JMenu s and JMenuItem s.

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