wood burning stoves 2.0*
The moose likes Swing / AWT / SWT and the fly likes Combo box with a key listener- pls help Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Combo box with a key listener- pls help" Watch "Combo box with a key listener- pls help" New topic
Author

Combo box with a key listener- pls help

Sajee Joseph
Ranch Hand

Joined: Jan 17, 2001
Posts: 200
HI everbody,
I need a combobox. The combo box will be intially loaded with some items. Now i need a key listener to this combo box, such that when i click ok 's', i need to display the items which begins with 's'. How do i go about this.
Regards
Saj
Chantal Ackermann
Ranch Hand

Joined: Sep 28, 2000
Posts: 508
hi Saj,
i've never done that with a combo box only with a list. if its not working with a KeyListener and a uneditable combobox then try to set the JComboBox to setEditable(true). you will have to make sure that the user can use the edit-feature only for the fast lookup.
anyway, try it first with setEditable(false). the combobox must have the focus (mouseclick inside the combo). the keylistener listens to different triggers (KEY_TYPED, KEY_PRESSED). which one is the appropriate depends on the platform and the key. i think, key_typed is the one for you.
chantal
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Combo box with a key listener- pls help
 
Similar Threads
Setting Focus in a DeleteKeyListener
DropDown Selection List onKeyPress in Text Box
render combo box
key listener for editable combo box.
Combo box selection