Highlight ComboBox

Hi everybody,

i want to set editable a combobox and set selected(highligted) the first index when i pressed F2. The code i write below;

comboBox.addKeyListener(new KeyAdapter(){

public void keyPressed(KeyEvent e) {

if(e.getKeyCode() == KeyEvent.VK_F2){

//?

comboBox.setEditable(true);

}

}

});

how can i set highlighted ?

[387 byte] By [asilazmaza] at [2007-11-27 11:54:07]
# 1

In future Swing related questions should be posted into the Swing forum.

Consult the API for the component in question to discover which methods may be of use to you in achieveing the desired results

cotton.ma at 2007-7-29 18:54:08 > top of Java-index,Java Essentials,Java Programming...
# 2

so sorry :(

asilazmaza at 2007-7-29 18:54:08 > top of Java-index,Java Essentials,Java Programming...
# 3

http://forum.java.sun.com/help.jspa?sec=formatting

CeciNEstPasUnProgrammeura at 2007-7-29 18:54:08 > top of Java-index,Java Essentials,Java Programming...
# 4

Also see

http://java.sun.com/docs/books/tutorial/uiswing/components/combobox.html

cotton.ma at 2007-7-29 18:54:08 > top of Java-index,Java Essentials,Java Programming...