Deepak B
Deepak B

Reputation: 2335

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)

Upvotes: 0

Views: 214

Answers (1)

JB Nizet
JB Nizet

Reputation: 691635

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 JMenus and JMenuItems.

Upvotes: 3

Related Questions