• Post Reply Bookmark Topic Watch Topic
  • New Topic

JComboBox and Focus

 
Phil Harron
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • 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
 
Rene Liebmann
Ranch Hand
Posts: 196
  • Mark post as helpful
  • send pies
  • 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
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!