aspose 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
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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: adding JPopupMenu to a JMenuBar