This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

multiple listeners on JComboBox Urgent

 
john mattucci
Ranch Hand
Posts: 331
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
------------------
 
john mattucci
Ranch Hand
Posts: 331
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
is this possible yes no? anyone
 
Gregg Bolinger
GenRocket Founder
Ranch Hand
Posts: 15302
6
Chrome IntelliJ IDE Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
John, I am fairly sure that this is possible. However, I have never done it.
Sorry if that doesn't help much, just wanted to give you a response though.

------------------
Happy Coding,
Gregg Bolinger
 
Gregg Bolinger
GenRocket Founder
Ranch Hand
Posts: 15302
6
Chrome IntelliJ IDE Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
John, I am fairly sure that this is possible. However, I have never done it.
Sorry if that doesn't help much, just wanted to give you a response though.

------------------
Happy Coding,
Gregg Bolinger
 
Wilfried LAURENT
Ranch Hand
Posts: 269
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
john mattucci
Ranch Hand
Posts: 331
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic