|Oracle® Java Micro Edition Software Development Kit Developer's Guide
Release 3.2 for Windows
The Lightweight UI Toolkit (LWUIT) is a lightweight widget library inspired by Swing but designed for constrained devices such as mobile phones and set-top boxes. Lightweight UI Toolkit supports pluggable theme-ability, a component and container hierarchy, and abstraction of the underlying GUI toolkit. The term lightweight indicates that the widgets in the library draw their state in Java source without native peer rendering.
LWUIT is an open source project whose source is available at
Java ME SDK 3.2 ships with the LWUIT 1.5 library, which is installed as a NetBeans package. For information on this release, see the product page at:
The Lightweight UI Toolkit Developer's Guide is available in PDF and HTML formats:
As an open source project, LWUIT has an independent release schedule. The Java ME SDK Update Center updates LWUIT when an official binary is released.
It is possible that you might want to use a development version of the LWUIT library. You can add a newer version as described in Section 12.3, "Add a Different LWUIT Library".
The Resource Editor is an independent GUI tool for opening, creating, and editing resource packages for LWUIT.
To start the resource editor, go to the project view and select a project that uses the LWUIT library, then select Tools>Java ME > LWUIT Resource Editor.
The Resource Editor has its own help, and tutorials that are accessed from the Resource Editor's Help menu. These articles link back to the LWUIT blog. For traditional documentation, see the "Resources" chapter in the Developer's Guide mentioned in Section 12.1, "LWUIT and the Java ME SDK".
The LWUIT library can be added to any CLDC/MIDP or CDC/PBP Project. A library has typically been installed as a NetBeans module.
Right-click on a project and select Properties.
In the Build category, select Libraries & Resources, and click the Add Library... button.
In the Add Libraries window, scroll down and select LWUIT and click Add Library.
You can see the package under Libraries and Resources.
If you have a created a Zip or JAR from the unreleased LWUIT source you can add it in a similar fashion by pressing the Add Jar/Zip button.
This release provides new and updated demos and sample code. Most of these demos are self-evident user interface samples.
Many LWUIT demos access common internet sites and services through publicly available APIs. To see the demos working as intended you might have to change your proxy settings or create an exception in your antivirus software.
From the menu, select Help for an explanation of this demo.
This application has demos for many features. From the Menu choose About for a description of the demo. Choose a subdemo and press the Help soft button for an explanation.
This application implements IO features. For example, type LWUIT in the Search box, choose blog from the Type menu, and press Go. Click the search results to load the page into your system's default browser.
This demo features a search performed by distance, title, rating, or relevance. Search results can be mapped. To "makeover" the demo by choose a different theme from the Menu.
This demo tests drawing speed for different components. Press the Start button to cycle through a series of animations. To change the performance you can edit the frame rate in SpeedMIDlet.java. You can also affect the performance by changing the emulator's heap size. In the Device Selector, right-click on the device, select Properties from the context menu, and change the Heapsize value.
This application shows a contacts list and provides date and time information for contacts displayed on the home page. Use + to add contacts and - to remove them. Press the sun symbol to toggle the time format between 24 hour time and civilian time.
The demo is a simple tip calculator. The default service is restaurant staff. To change the service type, click the up arrow to highlight the service types. Use the right or left arrows to highlight a service type, then click the select button.