O'Reilly logo

Vaadin 7 Cookbook by Ondrej Kvasnovsky, Jaroslav Holan

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Styling widgets

The default CSS style of a custom widget is based on the GWT style. In this recipe, we will show how to change it. As shown in the following screenshot, we will make a simple change. The label of the counter is aligned at the bottom and has a gray color.

Styling widgets

Getting ready

We create a widget text field with a counter as described in the Creating a TextField with counter recipe.

How to do it...

Carry out the following steps to learn how to style a widget:

  1. In the constructor of the CountedTextFieldWidget class, we set the primary CSS style name of each widget because we want to set a new style for a specific widget. The name consists of a base ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required