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

Why menu doesn't display

 
Hui Zhao
Ranch Hand
Posts: 116
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Thanks
 
Brian Cole
Author
Ranch Hand
Posts: 902
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Hui Zhao:
Why menu doesn't display


I don't see setJMenuBar(menuBar) anywhere in your code.
 
Hui Zhao
Ranch Hand
Posts: 116
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please ignore menuBar.
Now my question is can I add a popup menu to an applet directly?

Regards!
 
Qunfeng Wang
Ranch Hand
Posts: 434
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Add a MouseListener to you applet, and show the popup menus in your mousePressed() method.

Please refer to: How to use menus
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic