I have a JComboBox
with an key listener.
When I hit <enter>
, I fire off some action, and then I need to to lose focus on the JComboBox
!
To focus on it, I can do JComboBoxObject.grabFocus();
But doing transferFocus()
to get the focus to a next element (I don't care WHERE the focus goes, just away from combo box) does NOT work.
Doing grabFocus()
from another combo box works, but seems like a pretty annoying hack to me. Is there a better solution?