wood burning stoves 2.0*
The moose likes Swing / AWT / SWT and the fly likes Combine two different JPopupmenu 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 "Combine two different JPopupmenu" Watch "Combine two different JPopupmenu" New topic
Author

Combine two different JPopupmenu

tom osayo
Greenhorn

Joined: Nov 02, 2009
Posts: 13
My code below displays only the menu item from pop2. Any idea ?

Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19538
    
  16

Because you're showing the test popup menu which is the same as popup2.

What you're trying to do won't work. You're adding popup2 to popup as a component, not as an extension of the menu items.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
tom osayo
Greenhorn

Joined: Nov 02, 2009
Posts: 13
Thanks
Is there a way to add as popup2 as a popupmenu to popup

If so let me know
Rob Camick
Ranch Hand

Joined: Jun 13, 2009
Posts: 2090
    
    7
Maybe a "sub menu" is all you need. Read the section from the Swing tutorial on How to Use Menus.
tom osayo
Greenhorn

Joined: Nov 02, 2009
Posts: 13
thanks
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Combine two different JPopupmenu
 
Similar Threads
Toolbar
KeyBoard events not listening in JPopupMenu
Problem while working with JPopupMenu
Right-Click on JMenuItem
Scrolling JMenu