This week's book giveaway is in the OCAJP 8 forum.
We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line!
See this thread for details.
The moose likes Swing / AWT / SWT and the fly likes Adding Submenu to JMenuItem. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA Java SE 8 Programmer I Study Guide this week in the OCAJP 8 forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Adding Submenu to JMenuItem. " Watch "Adding Submenu to JMenuItem. " New topic
Author

Adding Submenu to JMenuItem.

Rush Art
Greenhorn

Joined: Oct 17, 2009
Posts: 7
Hello, I having trouble finding out how to attached submenu to the JMenuItem "Global" with text such as "Max,Min,Sum" as shown on the taken picture. Any idea how the code is for this one?

Thanks.






[Thumbnail for Submenu.JPG]

Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 20137
    
  30

Global shouldn't be a JMenuItem but a JMenu instead. That one has methods to add more JMenuItems. And remember, JMenu extends JMenuItem.

Moving to Swing.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6 - OCEJPAD 6
How To Ask Questions How To Answer Questions
Maneesh Godbole
Saloon Keeper

Joined: Jul 26, 2007
Posts: 10747
    
    9

Recommended reading: http://java.sun.com/docs/books/tutorial/uiswing/components/menu.html


[How to ask questions] [Donate a pint, save a life!] [Onff-turn it on!]
Rush Art
Greenhorn

Joined: Oct 17, 2009
Posts: 7
Thanks a lot I manged to get this working.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Adding Submenu to JMenuItem.
 
It's not a secret anymore!