![]() ![]() ![]() | |
![]() | |
![]() | |
![]() |
You can use the FocusManager to specify the order in which components receive focus when a user presses the Tab key to navigate in an application. You can use the FocusManager API to set a button in your document that receives keyboard input when a user presses Enter (Windows) or Return (Macintosh). For example, when a user fills out a form, they should be able to tab between fields and press Enter (Windows) or Return (Macintosh) to submit the form.
All components implement FocusManager support; you don't need to write code to invoke it. The FocusManager also interacts with the System Manager, which activates and deactivates FocusManager instances as pop-up windows are activated or deactivated. Each modal window has an instance of a FocusManager so the components in that window become their own tab set, preventing the user from tabbing into components in other windows.
The FocusManager recognizes groups of radio buttons (those with a defined RadioButton.groupName
property) and sets focus to the instance in the group that has a selected
property that is set to true
. When the Tab key is pressed, the Focus Manager checks to see if the next object has the same groupName
as the current object. If it does, it automatically moves focus to the next object with a different groupName
. Other sets of components that support a groupName
property can also use this feature.
The FocusManager handles focus changes due to mouse clicks. If the user clicks on a component, that component is given focus.
The FocusManager does not automatically assign focus to a component in an application. The main window and any pop-up windows will not have focus set on any component by default unless you call focusManager.setFocus
on a component.
![]() | |
![]() | |
![]() | |
![]() ![]() ![]() |