This week's book giveaway is in the Performance forum.
We're giving away four copies of The Java Performance Companion and have Charlie Hunt, Monica Beckwith, Poonam Parhar, & Bengt Rutisson on-line!
See this thread for details.
Win a copy of The Java Performance Companion this week in the Performance 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
[Thumbnail for Submenu.JPG]
Example
 
Rob Spoor
Sheriff
Pie
Posts: 20552
57
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: 11070
13
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