aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes showing/hiding JPopupMenu having JButtons as its elements Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "showing/hiding JPopupMenu having JButtons as its elements" Watch "showing/hiding JPopupMenu having JButtons as its elements" New topic
Author

showing/hiding JPopupMenu having JButtons as its elements

manasa manogna
Greenhorn

Joined: Mar 29, 2011
Posts: 21
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

Joined: Jun 13, 2009
Posts: 2090
    
    7
Don't use JButtons in your menus.

See How to Use Menus for examples of creating menus with sub menus.
manasa manogna
Greenhorn

Joined: Mar 29, 2011
Posts: 21
Hi

Thanks for the reply, But using the JButtons in the menu is a compulsory requirement for me. Please help.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: showing/hiding JPopupMenu having JButtons as its elements
 
Similar Threads
Problem while working with JPopupMenu
show and hide a JPopupMenu
Swing elements not displaying properly
How to display Right-click popup menu in JPanel?
JMenuItem question