Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to put menu item in Title bar

 
Manoj Tyagi
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.........

Thanks,

Manoj
 
Gregg Bolinger
GenRocket Founder
Ranch Hand
Posts: 15302
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Manoj Tyagi
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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....


Manoj
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34681
367
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic