Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JMenu

 
Val Dra
Ranch Hand
Posts: 439
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi i have placed a JButton and JTextField into a JMenuItem now when the menu expands i see both of them. The problem is when i hit the button i'd like the JMenu to close, does anyone knows how to force it to colapse ?
Thanks.
 
Manfred Leonhardt
Ranch Hand
Posts: 1492
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Val,
Have you looked into the setPopupMenuVisible method? It might be just the thing ...
Regards,
Manfred.
 
Val Dra
Ranch Hand
Posts: 439
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How will i close the popup as well ? The way regular popups work when you hit an item on it it closes or you can just click else where on your frame . With my button being placed into JMenuItem with textfield hitting the JButton will not close the menu , i though of transfering the focus to someother component but it failed. I might have to redesign my approach.
Thanks
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic