• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

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

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
Ranch Hand
Posts: 129
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
snakes are really good at eating slugs. And you wouldn't think it, but so are tiny ads:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic