LWUIT supports the following resource elements: images, animation, bitmap fonts, localization bundles, and themes. Resources are delivered as a bundle - a binary file that can be loaded and used on the device. Java ME Platform SDK supports LWUIT with an integrated Resource Manager for creating and maintaining resource bundles.
The LWUIT tools and the tools JavaME SDK provide for LWUIT are not identical. The Java ME SDK uses a build and Apache Ant tasks to create resource bundles.
Note - Currently LWUIT projects must be built with Java 1.6.
The Resource Manager is a graphical tool for creating resource bundles and adding them to the build process.
Select a project that contains the LWUIT libraries. In the project tree, Locate the LWUIT Resources node.
Enter a bundle name and click OK.
You are ready to add resources to the new bundle.
Select a resource, and select Windows > Properties to view and edit the resource.
Resources you edit or create are added to the bundle. See Resource Types for a brief description of the resources you can use.
JPG and PNG files. The file name can be changed and you can choose to pack the file to save space.
Animations. GIF files. You just supply a name.
Font. The font is created from a font on your system - for example, Arial or Courier. In the event that the font you choose is missing, you can choose a system font as a backup. Default system fonts are: Dialog, DialogInput, Monospaced, Serif, and SansSerif.
Note - The Lightweight UI Toolkit Developer’s Guide describes choosing between a font in a file, or system fonts. This does not apply to the Java ME SDK Resource Manager, which uses only system fonts.
Localization. Choose the main localization bundle, for example, foobar.properties. This main bundle is then added with a "default" ID. Other locales are added with their proper ID. For example, foobar_en_GB.properties is added with the ID en_GB. Unfortunately this resource must be recreated in the resource manager when more locales are added (or removed).
Theme. Adds the .conf theme file. See the Lightweight UI Toolkit Developer’s Guide.
The LWUIT library can be added to any MIDP Project.
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, select LWUIT and click Add Library.
You can see the package under Libraries and Resources.