Label truncated

Hi,

I am learning to use Vaadin, and i encoutered the following issue :
Label title = new Label(“

Vaadin

”,Label.CONTENT_RAW);
=>
the highest and lowest parts of the word “Vaadin” are missing !

I tried to add these properties, it changes nothing :
title.setHeight(“200px”);
title.setWidth(“300px”);

Then i tried to put the Label inside a Panel, but “Vaadin” is still truncated :
Panel panel = new Panel(“Panel Containing a Label”);
panel.setHeight(“200px”);
panel.setWidth(“300px”);
panel.addComponent(new Label(“ Vaadin ”,Label.CONTENT_RAW));

Is there a solution ?

Kind regards
Eric (from Paris)
12533.jpg

Hi,

there is a line-height of 18px defined in the default theme (reindeer) of Vaadin. Try overriding that with a more suitable value.

-Tepi

Hi Tepi,

How can i override this property ?
Is it possible to override it in the java code ? or there is a xml file to update ?

Regards
Eric

Hi,

If you don’t already have your own theme, then
read this
for a quick reference for how to make one. Basically you just need a CSS file in the correct location, add the CSS rules you want there and make your application use the theme (Application.setTheme(“yourtheme”)).

You might want to give the label a specific style name (addStyleName -method) in order to not apply the changed line-height to every label in the application.

-Tepi