File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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
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: 19543
    
  16

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
How To Ask Questions How To Answer Questions
Maneesh Godbole
Saloon Keeper

Joined: Jul 26, 2007
Posts: 9990
    
    7

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.
 
Similar Threads
Clickable JMenu?
menu not showing up on gui window
JMenu Submenu
Layout Problems
JFrame and JMenu