• 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
  • paul wheaton
  • Ron McLeod
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

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?
 
Oh sure, it's a tiny ad, but under the right circumstances, it gets bigger.
Clean our rivers and oceans from home
https://www.kickstarter.com/projects/paulwheaton/willow-feeders
reply
    Bookmark Topic Watch Topic
  • New Topic