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 Calendar

The Calendar class represents a widget for displaying dates. Calendar, like Form, is also a subclass of Container and inherits its characteristics.

The default display format shows one month at a time, with the current date highlighted. This view of the month is provided by the MonthView class, which can be accessed only from within the com.sun.lwuit package. This means we cannot use MonthView, nor can we see it in the API documentation.

Creating a Calendar

A calendar object can be instantiated by using one of the two constructors of the Calendar class. The constructors are:

  • public Calendar()—the calendar object created will be initialized to the current date and time. BorderLayout is the default layout manager for Calendar.
  • public Calendar(long ...

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