Loading...
Important Notice - Forums is archived

To simplify things and help our users to be more productive, we have archived the current forum and focus our efforts on helping developers on Stack Overflow. You can post new questions on Stack Overflow or join our Discord channel.

Product icon
TUTORIAL

Vaadin lets you build secure, UX-first PWAs entirely in Java.
Free ebook & tutorial.

how can i change font size in Label ???

Eranga Kodikara
1 decade ago Mar 08, 2010 8:30am
Jouni Koivuviita
1 decade ago Mar 08, 2010 9:22am

You need to specify a style name for the label and have a custom theme for your application. Then you can specify the font size in your theme's CSS like so:

.v-label-stylename {
    font-size: 24px;
    line-height: normal;
}

Remember to adjust the line-height for the label as well. Use the value "normal" if you wish for the browser to decide which is best for the given font size.

Last updated on Mar, 8th 2010
Eranga Kodikara
1 decade ago Mar 08, 2010 11:05am
Jouni Koivuviita
1 decade ago Mar 08, 2010 1:56pm
Deleted User
1 decade ago Jul 25, 2010 5:45pm
Steve Pech
1 decade ago Sep 11, 2010 4:02pm

Hey!
I had the same problem so I looked for some other methodes to change the labeltext.
Label.setValue(String) does the thing for me. No second label and the text is shown in the correct size.

Greetings,

Steve

Henri Sara
1 decade ago Sep 13, 2010 5:42am

pepe belisario cueto: 2. Sometimes it makes me think that Label "content" and "caption" are different things ( need to verify with the Book of V ). This is because at creation time of a Label it's CSS style applies to the "content" while styles doesn't apply after calling setCaption. Ex.

Just to clarify this: label cation is not the contents of the label - the label value is.

Cations are in general not a part of the component, but the layout around the component may (or may not) display them, usually above (most layouts) or to the left (FormLayout) of the component. This is perhaps made a little confusing by the fact that a few components (e.g. Button) do manage their own captions and show them inside the component, rather than letting the layout do it.

The label can have a caption and a value, and its value can also be wired to a (property) data source.

Basil Bourque
7 years ago Jul 27, 2014 4:16am
Steffen Ewert
7 years ago Oct 16, 2014 6:57am
Steffen Ewert
7 years ago Oct 16, 2014 7:15am
Joacim Päivärinne
7 years ago Oct 20, 2014 6:01am
Steffen Ewert
7 years ago Oct 24, 2014 8:13am
Joacim Päivärinne
7 years ago Oct 30, 2014 7:17am
Steffen Ewert
7 years ago Oct 30, 2014 6:17pm
Joacim Päivärinne
7 years ago Oct 31, 2014 6:35am
Steffen Ewert
7 years ago Oct 31, 2014 8:03am
Joacim Päivärinne
7 years ago Oct 31, 2014 11:32am
Daniel Catalano
7 years ago Nov 17, 2014 7:24pm