This week's giveaway is in the EJB and other Java EE Technologies forum. We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan on-line! See this thread for details.
I was wondering if it was possible to add multiple listeners to a JComboBox eg. right now I have a ActionListener attached to the JComboBox, but I want to add a KeyListener to respond to both the up and down key is this possible ------------------
I am almost sure that this is not possible. I don't think that you (easily) get information about key stroke since some keys are reserved by the combo box (this is particulary the case for UP and DOWN). We are here more in the field of look-and-feel. Maybe you should have a look to the implementation of ComboBoxUI to see if the key events are consumed or not. W.
Joined: Nov 03, 2000
is there a way to block them (ie the up or down key) because when the user presses the up or down key it interacts with the JComboBox and it crashes my programme