I know isFocusTraversable of Component returns the value of a flag that indicates whether this component can be traversed using Tab or Shift-Tab keyboard focus traversal. But I don't know how to make certain component in my container to be not Tab Traversable or to be Tab Traversable. Is there any attribute on Component that I could set to achieve that? Or if there is anyway to do that at all? Anyone could help? Thanx.
If you put a focusListener on the component and then when it gets focus do a transferFocus() it will move on to the next component - effectively skipping this one.
"JavaRanch, where the deer and the Certified play" - David O'Meara
While transferFocus() works, the "Politically correct way", or so Sun says, is to create your own textfield class that extends JTextfield, and override the isFocusTraversible() method to return false, and then the FocusManager will skip over the textfield. Mark Spritzler
I would retract and say that transferFocus() is great for making the Enter key act like the Tab key. But I still like the elegance of overriding the isFocusTraversible() method to make a JTextField Read-only Mark