How to set a tab order



I have multiple text editors in my component. I want to have a particular tab order for these text editors. Is it possible.

What I observe is, the tab order is defined by the order in which the text editors are created. Can we change this order ?



Check out the KeyboardFocusTraverser class.


Or just use Component::setExplicitFocusOrder



Thanks, that helped. I should have tried setExplicitFocusOrder before posting…I have one more issue, which I am not able to resolve.

When I disable a TextEditor, I donot get the same visual effect that we have when we disable a label !!!

The main problem I am facing is, I have a series of texteditors where user can enter only numeric values. And, based on certain conditions,
these text editors get enabled or disabled.

  1. If I use labels as UI for user to input values, I cannot validate if user has entered only numeric values, but when I disable the label, the text gets grayed out, and it appears disabled even visually to the user.

  2. If I use TextEditor, I can easily restrict user from entering only numeric values by using setInputRestrictions(), but when I disable the texteditor, visually it does not appear to be disabled as the text within doest not get grayed out…

Can anybody help ?