File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

adding JPopupMenu to a JMenuBar

 
Tal Tal
Ranch Hand
Posts: 40
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi
how can i add a JPopupMenu to a JMenuBar?
thanks
 
Gregg Bolinger
GenRocket Founder
Ranch Hand
Posts: 15302
6
Chrome IntelliJ IDE Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why would you want to do that?
 
Tal Tal
Ranch Hand
Posts: 40
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 15302
6
Chrome IntelliJ IDE Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic