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

Adding Submenu to JMenuItem.

 
Rush Art
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.



Submenu.JPG
Example
[Thumbnail for Submenu.JPG]
 
Rob Spoor
Sheriff
Pie
Posts: 20495
54
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Maneesh Godbole
Saloon Keeper
Posts: 11021
12
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
 
Rush Art
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks a lot I manged to get this working.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic