Win a copy of Java EE 8 High Performance this week in the Java/Jakarta EE forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Setting Focus in a DeleteKeyListener  RSS feed

Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am trying to clear out a non-editable combo box using the delete key. The delete key has a listener attached to it, which tries to force the focus to the previous combo box when the delete key is released. This all seems to be working alright except that when the action listener on the previous combo box fires, I have a check on the listener which checks to see if the component has focus and it's failing that check. Even though I've called requestFocusInWindow() method on the previous combo box, within the delete key listener.

I need for it to return true when it does the check on to see if the component has focus.

Note: I've tried using the invokeLater() and that doesn't seem to work either.

Any help would be much appreciated!!
You're not going crazy. You're going sane in a crazy word. Find comfort in this tiny ad:
ScroogeXHTML 7.2 - RTF to HTML5 / XHTML converter
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!