1 Attachment(s)
FieldLabel.setStyleName causes the corresponding widget to be misaligned
I have a FieldLabel and I want to set the style to be bold. However, when I call setStyleName, the corresponding widget gets moved down a line so it isn't aligned with the field label:
So this code:
FieldLabel name = new FieldLabel();
name.setText("Name");
name.setStyleName("boldText");
TextField nameFld = new TextField();
nameFld.setEmptyText(""Enter your name...");
name.add(nameFld);
Looks like this:
Attachment 39926
Doing things such as:
name.addStyleName("boldText");
or
name.setStyleName("boldText", true)
keeps the alignment, but it results in the style not getting recognized and displays in plain text.
Has anyone seen this or figured out a workaround? If I set the style to something different, such as changing the color to red, the addStyleName works - for some reason it just doesn't like the text to be bold.