Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

In what way can I avoid disapperaing the item of JPopupMenu?  RSS feed

 
Oleg Vasylenko
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a such code below to create and show popupmenu.
Popupmenu appear when I need. I choose menu "Menu1" and object JPanel appear as I wish. JPanel contains JFormattedTextField,JComboBox and JButton.
When I try to choose the item from JComboBox the main popup menu disapper.
What should I do to prevent such behaviour?
Thanks a lot!


[ January 11, 2008: Message edited by: Oleg Vasylenko ]
 
Mark Newton
Ranch Hand
Posts: 129
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well - there is a PopupMenuListener, that has a method, popupMenuWillBecomeInvisible() - this is called just before the popup menu disappears. I'd guess that you could interrupt this and stop it from happening.

However - it doesn't sound like the best approach - is there a particular reason that you need to use a JPopupMenu for it, rather than something else, like a JDialog?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!