DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world
Enable Custom FocusTraversalPolicy In Swing
Every container in Swing/AWT can be given a FocusTraversalPolicy with:
public void setFocusTraversalPolicy(FocusTraversalPolicy policy)
Remember to enable the container as a FocusCycleRoot:
setFocusCycleRoot(true)
Together it looks like:
container.setFocusTraversalPolicy(myCustomPolicy); container.setFocusCycleRoot(true);





