Disable JComboBox pop-up item selection on arrow keys

46 Views Asked by At

I have a very simple desire - I don't want JComboBox respond to arrow key presses. I don't want to select items in the pop-up on arrow keys, or in fact I don't want to show pop-up on pressing down arrow either.

It should be a simple task, but all the threads that I find instead advise people "DON'T DO IT! Don't change default expected behavior! Users will hate you!"

Well, without going into detail - I need it. I have a very specific application that does not require combo-box to respond to arrows. I still need to keep it focused, though.

How do I disable arrow keys? I tried adding a KeyListener, but the box still responds to default key binding.

Thank you.

0

There are 0 best solutions below