• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Junilu Lacar
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Ganesh Patekar
  • Tim Moores
  • Pete Letkeman
  • Stephan van Hulst
Bartenders:
  • Carey Brown
  • Tim Holloway
  • Joe Ess

NextFocusableComponent -> FocusTraversalPolicy  RSS feed

 
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all again!
I'm using a Swing application and I noticed that "NextFocusableComponent" is being deprecated and replaced by the "FocusTraversalPolicy".
Does anyone here know how does it work?? All I want is set an order for my controls when the TAB key is pressed.
Thanks!!
 
Ranch Hand
Posts: 4632
 
Carlos Delgado
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for your reply!
But in the Sun Java help pages there are not examples of it... :'( I was trying to avoid those eternal readings without examples.
All I want is a little sample for changing focus between 3 JTextFields! Any ideas?
 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here's something to play around with - it just reverses the 'normal' tab
order i.e. bottom to top, but you can make it anything you want, in keyPressed()

Don't know if this is a 'reasonable' way to do it, or if there's any pitfalls doing it this way, so lots of testing required.

 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It seems the correct is something like this

 
Carlos Delgado
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks, Michael! I got it working now!
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!