aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes Is it possible to attach KeyListener with JComboBox? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Is it possible to attach KeyListener with JComboBox?" Watch "Is it possible to attach KeyListener with JComboBox?" New topic
Author

Is it possible to attach KeyListener with JComboBox?

n Afsheen
Greenhorn

Joined: Jul 14, 2001
Posts: 2
Is it possible to attach KeyListener with JComboBox, when it is setEditable? and can we set Editor other than its defaut editor
Shishir Parikh
Greenhorn

Joined: Aug 09, 2001
Posts: 4
Yes, technically it is possible to use a KeyListener with an editable JComboBox.
But an editable JComboBox is a composite component, i.e., it is made up of more than 1 basic components (which components, depends on the look & feel). If one tries to use low level listeners with it, then one might have to change the Look & Feel code for it depending on the systems on which it is going being used, which is not a very desirable prospect.
Hence, it is advisable to use only higher level events like ItemEvent and ActionEvent with an editable JComboBox.
Njoy,
SHISH.
Originally posted by n Afsheen:
Is it possible to attach KeyListener with JComboBox, when it is setEditable? and can we set Editor other than its defaut editor

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Is it possible to attach KeyListener with JComboBox?