File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Swing / AWT / SWT and the fly likes adding JPopupMenu to a JMenuBar Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "adding JPopupMenu to a JMenuBar" Watch "adding JPopupMenu to a JMenuBar" New topic
Author

adding JPopupMenu to a JMenuBar

Tal Tal
Ranch Hand

Joined: Dec 10, 2003
Posts: 40
hi
how can i add a JPopupMenu to a JMenuBar?
thanks
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15299
    
    6

Why would you want to do that?


GenRocket - Experts at Building Test Data
Tal Tal
Ranch Hand

Joined: Dec 10, 2003
Posts: 40
because, i already have in my project a popupmenu, which now i also want to add that menu to the menubar, so i wondered if there's a way to add that jpopupmenu to the menubar instead of creating the same menu as a JMenu and adding that.

is there a way of doing that?
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15299
    
    6

Originally posted by Tal Tal:
because, i already have in my project a popupmenu, which now i also want to add that menu to the menubar, so i wondered if there's a way to add that jpopupmenu to the menubar instead of creating the same menu as a JMenu and adding that.

is there a way of doing that?


Not that I know of. You could create these menu items in a method and then call that method for creating both your JMenuBar and your JPopupMenu. That way, you have only coded those items one time.
 
wood burning stoves
 
subject: adding JPopupMenu to a JMenuBar
 
Similar Threads
JPopupMenu or JMenu - neither is quite what I'm after.
Right-Click on JMenuItem
repaint() method problem
JPopUp
Image is always behind the menu (swing)