Component comp = getFocusOwner(); while(comp != null) { if(comp instanceof JComboBox) { JComboBox combo = (JComboBox)comp; combo.setSelectedItem(combo.getEditor().getItem()); break; }  comp = comp.getParent(); }
		public void keyPressed(KeyEvent evt)		{			if(evt.isConsumed())				return;			if(evt.getKeyCode() == KeyEvent.VK_ENTER)			{				ok();				evt.consume();			}			else if(evt.getKeyCode() == KeyEvent.VK_ESCAPE)			{				cancel();				evt.consume();			}		}