aspose file tools*
The moose likes Beginning Java and the fly likes JMenu Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "JMenu" Watch "JMenu" New topic
Author

JMenu

Val Dra
Ranch Hand

Joined: Jan 26, 2001
Posts: 439
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.

Val SCJP <BR>going for SCJD
Manfred Leonhardt
Ranch Hand

Joined: Jan 09, 2001
Posts: 1492
Hi Val,
Have you looked into the setPopupMenuVisible method? It might be just the thing ...
Regards,
Manfred.
Val Dra
Ranch Hand

Joined: Jan 26, 2001
Posts: 439
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JMenu