Skip to main content

How to get a button that behaves like a JMenuBar?

2 replies [Last post]
leo_test
Offline
Joined: 2004-04-27

I want to have in my application a JMenuBar somewhere in the middle of my app, which just pops up Menu-Items. The main reason, why I cannot use the JMenuBar itself is due to the fact, that the JMenuBar is layouted like it would be in the Toolbar. But I need it to be layouted like a Button.

The problem becomes a pain, when using customized LaF, where the MenuBar is layouted like the above mentioned policy. And then it becomes really recognizable cause the background is painted.

The reason, why I wanna stuck with the JMenuBar is, that it provides mechanism to automatically position the Popup-window resp. moves around when the frame is dragged. But if there is already a similar button available, I would take it as well.

Setting the background or opaque does not help.

Anybody an idea, how I can get a button with the above described behaviour?

LeO

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
leo_test
Offline
Joined: 2004-04-27

Thx, that is exactly what I was looking for.

LeO

kirillcool
Offline
Joined: 2004-11-17

Flamingo has command buttons with different options for displaying popups.

Thanks
Kirill

http://www.pushing-pixels.org/?p=1737