File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

showing/hiding JPopupMenu having JButtons as its elements

 
manasa manogna
Greenhorn
Posts: 23
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Friends

my requirement is I have a JButton and on clicking it, a JPopupMenu will be opened whose menu elements are JButtons. Upto this I am fine. Now, When I click on one of the menu element JButton, I need some other menu to be opened. When this second menu is opened, the first menu should stay opened. I am able to create both the menus successfully. But when I click the first menu's JButton element, it is opening the second menu but the first menu is getting closed. How to keep this menu stay opened even after clicking it's element. the main thing here is the elements of the menu is JButtons so I need the help with this in mind. Please help. This is very very urgent for me. Please. any solution with source code is appreciated. If it is not possible then atleast code chunk suggestion to achieve this or any source materual will be great.
 
Rob Camick
Ranch Hand
Posts: 2475
8
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Don't use JButtons in your menus.

See How to Use Menus for examples of creating menus with sub menus.
 
manasa manogna
Greenhorn
Posts: 23
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

Thanks for the reply, But using the JButtons in the menu is a compulsory requirement for me. Please help.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic