Exit Print View

Java Platform Micro Edition Software Development Kit Version 3.0, Mac OS

Get PDF Book Print View
 

Document Information

Getting Started

Features

Using Sample Projects

Creating and Editing Projects

Viewing and Editing Project Properties

Running Projects in the Emulator

Searching the WURFL Device Database

Finding Files in the Multiple User Environment

Profiling Applications

Network Monitoring

Lightweight UI Toolkit

LWUIT and the Java ME SDK

Security and MIDlet Signing

CLDC Emulation on a Windows Mobile Device

Installing CLDC Emulation on a Windows Mobile Emulator (Windows Only)

On-device Debugging

Command Line Reference

Logs

JSR Support

JSR 75: PDA Optional Packages

JSR 82: Bluetooth and OBEX Support

JSR 135: Mobile Media API Support

JSR 172: Web Services Support

JSR 177: Smart Card Security (SATSA)

JSR 179: Location API Support

JSR 180: SIP Communications

JSR 184: Mobile 3D Graphics

JSR 205: Wireless Messaging API (WMA) Support

JSR 211: Content Handler API (CHAPI)

JSR 226: Scalable 2D Vector Graphics

JSR 229: Payment API Support

JSR 238: Mobile Internationalization API (MIA)

JSR 256: Mobile Sensor API Support

Index


LWUIT and the Java ME SDK

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.


Create a Resource Bundle and Add It to the Build Process

The Resource Manager is a graphical tool for creating resource bundles and adding them to the build process.

  1. Select a project that contains the LWUIT libraries. In the project tree, Locate the LWUIT Resources node.

  2. To add a resource bundle, right-click LWUIT Resources and select Add Bundle from the context menu.

  3. Enter a bundle name and click OK.

    You are ready to add resources to the new bundle.

  4. 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.

Resource Types

This topic briefly summarizes resource types. Resources are fully described in the Lightweight UI Toolkit Developer’s Guide for version 1.2.1.

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.

Add a Different LWUIT Library

The LWUIT library can be added to any MIDP Project.

  1. Right-click on a project and select Properties.

  2. In the Build category, select Libraries & Resources, and click the Add Library... button.

  3. In the Add Libraries window, select LWUIT and click Add Library.

    You can see the package under Libraries and Resources.