• Post Reply Bookmark Topic Watch Topic
  • New Topic

FocusTraversalKeys challenge  RSS feed

 
Med Shabe
Ranch Hand
Posts: 84
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I need to navigate through the components using the tab key and also want to perform some kind of computations once the user has pressed the tab key. I can do the calculation but he tab stays in the current field.

I�m not sure how to set the focus to the next available component.

Any help is appreciated.

 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
it might be simpler to use a focusListener, or a documentListener

here's your code as a focusListener:
as tf3 is for the 'result' - I've changed that to unfocusable,
not sure what tf4 is for

 
Mahesh x Bogadi
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey Meb,

In your code, implementation of keylistener methods.. call the super(parent) methods!!!
 
Med Shabe
Ranch Hand
Posts: 84
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you both.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!