Adds a style name to component. The style name will be rendered as a HTML class name, which can be used in a CSS definition.
Label label = new Label("This text has style"); label.addStyleName("mystyle");
Each style name will occur in two versions: one as specified and one that is prefixed wil the style name of the component. For example, if you have a {@code Button} component and give it "{@code mystyle}" style, the component will have both " {@code mystyle}" and " {@code v-button-mystyle}" styles. You could then style the component either with:
.mystyle {font-style: italic;}
or
.v-button-mystyle {font-style: italic;}
This method will trigger a {@link com.vaadin.terminal.Paintable.RepaintRequestEvent RepaintRequestEvent}.
@param style the new style to be added to the component
@see #getStyleName()
@see #setStyleName(String)
@see #removeStyleName(String)