This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

showing/hiding JPopupMenu having JButtons as its elements

 
manasa manogna
Greenhorn
Posts: 23
  • 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: 2542
9
  • 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
  • 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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic