O'Reilly logo

LWUIT 1.1 for Java ME Developers by Biswajit Sarkar

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

The Label

The Label class provides a space for text, icon, or both. It does not directly react to user actions, and it does not receive focus by default either.

However, it is a very widely used widget, and it provides the basis for building many other widgets. Let us recall the examples that we worked with in Chapter 3 using composite widgets like the calendar. We have seen that these composite widgets use labels within themselves to display textual information. As we work our way through LWUIT, we shall see many more examples of labels being used as a foundation for more complex components.

The LabelDemo example

The following screenshot shows a number of labels with text, or an image or both:

Once we have had a brief introduction to the Label ...

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