Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Traversing using a KeyListener  RSS feed

 
Nicholas van Orton
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi folks,

I'm trying to set up a situation with two components - a JSpinner & JTextField - where I can traverse between the two using the 'Tab' key and have the text of the JSpinner & JTextField automatically selected once they are tabbed into.

At the moment, I've come up with this:



It works when tabbing from the JSpinner into the JTextField, but not the other way around.

I'm obviously doing something wrong.

If there are any clues, they would be very much appreciated.

Thanks
 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
try this change
 
Nicholas van Orton
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for your help, it worked!
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!