Anil
Anil

Reputation: 2465

Adding 2 different menu bars in java

I'm creating two menu bar 1st menu bar is for background color & 2nd is for text color.the application contains text component where user can type text.when user press either of menu scroll bar are shown on screen.for red,blue,green, color component the user can adjust the position of scroll bar,on pressing "OK" button the foreground or background of text component on frame changes according to the menu choice.

Upvotes: 0

Views: 1149

Answers (2)

RHT
RHT

Reputation: 5054

Two menus bars sounds awkward. Usually a single menu bar is more than enough to handle. Have you considered a popup menu instead for the second set of menus? If you still insist on adding multiple menu bars to a frame, consider changing their position for example use BorderLayout.SOUTH on one of them.

Upvotes: 0

kylewm
kylewm

Reputation: 634

One possibility is to create an MDI (one parent window, with an internal child window for each document). See: How to Use Internal Frames. The JDesktopPane and each JInternalWindow can have their own menus.

Upvotes: 1

Related Questions