Choice selection by typing text

Hi all. Is it possible to have an AWT Choice to work by the user typing the first letter of the selection they want, and thereby taking them to the first item that has that letter? e.g.

Choice has these items:

Apple

Banana

Carrot

If I type B on the Choice, it takes me to banana

[336 byte] By [isjm] at [2007-9-26 2:51:15]
# 1
try this code -choicebox.addKeyListener( new KeyAdapter() {public void keyReleased( KeyEvent e ) {char key = e.getKeyChar();choicebox.selectWithKeyChar( key );}});
prerna_b at 2007-6-29 10:38:25 > top of Java-index,Archived Forums,Java Programming...
# 2
Thanks for the reply. I am using JDK1.1.8 (platform dependant), so can't use the selectWithKeyChar() method. Any other ideas?
isjm at 2007-6-29 10:38:25 > top of Java-index,Archived Forums,Java Programming...
# 3
Got it working.
isjm at 2007-6-29 10:38:25 > top of Java-index,Archived Forums,Java Programming...