Reputation: 3327
If the textField is aligned to center, its text goes to right most corner when it is unselected. Just like when it is aligned to right. (tried getUnselectedStyles().setAlignment too, Moreover used parent container with flowlayout, boxlayout, borderlayout etc), Is this a bug here?
public NewForm(Resources res){
TextField tf = new TextField("Hello");
tf.getAllStyles().setAlignment(Label.CENTER);
add(tf);
}
Upvotes: 1
Views: 64
Reputation: 52760
Centering doesn't work for text field or text area. For text area we support it for display purposes but this is problematic when we switch from Java to native editing.
There is no good workaround for this at this time.
Upvotes: 1