Focus traversal order
1 posts in topic
Flat View  Flat View

Posted By:   Telmo_Amaral
Posted On:   Friday, May 14, 2004 05:09 AM

Using the deprecated method setNextFocusableComponent(), it is very easy to change the focus traversal order for only a few components on a GUI, while leaving unchanged the default order for all the other components. Is it possible to do the same using a FocusTraversalPolicy class? In all examples I found, the setFocusTraversalPolicy() method is invoked on the actual frame, meaning the custom FocusTraversalPolicy must address _all_ the components in the GUI. I know it's possible to set a panel to act as a focus cycle root, and then setFocusTraversalPolicy() can be invoked on it, but then again once the focus enters that panel, it can't leave it in a normal fashion.

Re: Focus traversal order

Posted By:   Telmo_Amaral  
Posted On:   Friday, May 14, 2004 06:37 AM

Never mind, found a solution for my case. The policy can be set on a tabbed pane, for only the components on it (even if it isn't a cycle root). In other cases, like a panel, nothing prevents from defining the components before first and after last, both outside the panel...
About | Sitemap | Contact