focus : Java Glossary


the most recently clicked window or component has the focus of the user’s attention. When a button in a frame has focus, the frame also has focus. Keystrokes are directed to the component with the focus.


Sample Code

Here is how to write a simple Custom FocusTraversalPolicy in

Enabing Tab and Shift-Tab

Focus Box

Swing paints a thin box on a button if it has focus. You can suppress that with:
theButton.setFocusPainted( false );

Learning More

Oracle’s Javadoc on Focus Spec : available:

This page is posted
on the web at:

Optional Replicator mirror
on local hard disk J:

Please the feedback from other visitors, or your own feedback about the site.
Contact Roedy. Please feel free to link to this page without explicit permission.

Your face IP:[]
You are visitor number