File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Swing / AWT / SWT and the fly likes How to put menu item in Title bar Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "How to put menu item in Title bar" Watch "How to put menu item in Title bar" New topic

How to put menu item in Title bar

Manoj Tyagi
Ranch Hand

Joined: Jun 11, 2002
Posts: 35
Dear All,

I have a problem with my GUI. Actually in Java generally we put menu & menu-items in menubar which is shown just below the Title bar ( in a JFrame )

But I want to put my Menu ( & further menu-item through pop-up or so) in Title bar so that I do not have to put the Menu-bar.

I am using swing version of Java GUI.....

Is there any way to do it.

Please help me out.........


Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15302

This can't be done with pure Java. With JNI, anything is possible, but chances are you won't want to mess with that. I wouldn't want to.

Out of curiosity, why do you want a menu in the Title bar? This is something I have to say I have never seen.

GenRocket - Experts at Building Test Data
Manoj Tyagi
Ranch Hand

Joined: Jun 11, 2002
Posts: 35
Thanks Gregg,

I agree with you , it may make a mess. But actually I was simulating a GUI which was made in C++ (may be) & it was having Menu (Items) in Title bar.

Moreover, what happened with me. I have completed my whole GUI & in most of the cases I have used Null Layout. Initially there was no need for Menu options like File>Save, Help>About etc.

But now in the end there is a need for all this. I have no space to do it & also I do not what to disturb Null layout. Only space seems to be in Title bar only.

Thats why this idea came. Any way thanks for your suggestions....

Jeanne Boyarsky
author & internet detective

Joined: May 26, 2003
Posts: 33124

The menubar is separate from the rest of the layout, so it won't mess up the flow. It does take up space, so there is little you can do there.

[OCA 8 book] [Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Other Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, TOGAF part 1 and part 2
I agree. Here's the link:
subject: How to put menu item in Title bar
It's not a secret anymore!