How do I set up a tabbing order in a Swing application?

Sandip Chitale

Chain the JComponents using the following API -

public void setNextFocusableComponent(Component aComponent)

(which is defined for all JComponents)

This specifies the next component to get the focus after this one, for example, when the tab key is pressed. Invoke this method to override the default focus-change sequence.

[FAQ Manager Note] You can also define your own FocusManager to define the sequence between components. Sometimes this is easier than setting the component sequence in each component.

Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

About | Sitemap | Contact