• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

JComboBox and Focus

 
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,
Could someone please help me!?
Let me set the scene: There's a Jcombobox on a panel. The user clicks on the combobox and a dropdown selection appears - what I want to happen now is if the user clicks somewhere else on the panel I want the JCombobox to dissappear..
The panel here is just an example - Its quite different within the Customers application.
Thanks in advance - Regards Phil
 
Ranch Hand
Posts: 196
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Phil,
did I understand you right, you want to hide the whole ComboBox and not only the popup part of it?
The default behavior of a ComboBox it that when it loses the focus, the poup disappears. You could use this event to ask for it. You can add a PopupMenuListener. Short before the popup will become invisible following event is fired: popupMenuWillBecomeInvisible.
Hope this helps

Rene
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic