Skip to main content

New Article: Using Styles, Themes, and Painters with LWUIT

Posted by editor on April 20, 2010 at 5:37 AM PDT

We've just published Biswajit Sarkar's new article, Using Styles, Themes, and Painters with LWUIT. LWUIT, the LightWeight User Interface Toolkit, is a java.net project:

LWUIT is a UI library that is bundled together with applications and helps content developers in creating compelling and consistent Java ME applications. LWUIT supports visual components and other UI goodies such as theming, transitions, animation and more.

In his article, Biswajit takes a look at several of the new and enhanced capabilities in LWUIT version 1.3, focusing on styles, themes, spinners, and tables. The article is packed with code snippets that demonstrate how to use the new capabilities, with corresponding screenshots showing what the code produces on the phone's screen.

Here's Biswajit's introduction:

Lightweight User Interface
Toolkit (LWUIT)
version 1.3, released in December 2009,
consolidates the modifications over version 1.1 initiated in
version 1.2 and incorporates some new ones too. It also introduces
three new components -- Tree, Table and Spinner. The use of the
Tree widget is demonstrated through the LWUIT Demo that
comes with the "http://java.sun.com/javame/technology/lwuit/">LWUIT download
bundle. In this article we examine the changes with respect to
Style and go on to check out Table and Spinner.

While LWUIT provides the capability to apply styles to individual user interface components, in an actual application it's probably more appropriate to apply LWUIT themes. Biswajit covers the evolution of the tools the LWUIT project has provided for developing themes, from the early Resource Editor to the LWUIT Designer to the newer Theme Creator. While the older tools can still be used, the Theme Creator provides the most advanced capability when it comes to developing themes for LWUIT applications.

Biswajit covers several new and enhanced features in LWUIT version 1.3. But there's a lot more that the development team has produced in 1.3, as Biswajit notes in his conclusion:

We have seen how the approach to styling has been modified since
LWUIT 1.1. We have also checked out the new Theme Creator and two new components that have been introduced in LWUIT 1.3.
However, there are a number of interesting new features that have
not been discussed here. These are listed in What's new in This
Release
in the LWUIT 1.3 download bundle.

If you're interested in some of the latest developments in LWUIT, Biswajit's Using Styles, Themes, and Painters with LWUIT provides a great introduction.


In Java Today, Arun Gupta presents TOTD #129: Managed Beans 1.0 in Java EE 6 - What and How ?:

Two new specifications released as part of the Java EE 6 platform are Managed Beans 1.0 and Interceptors 1.1. This Tip Of The Day (TOTD) attempts to explain the basics of Managed Beans 1.0. A later blog will explain the what/how of Interceptors 1.1. A short definition for a managed bean - its a POJO that is treated as managed component by the Java EE container...

James Sugrue announces the publication of My Latest Refcard: Java GUI Development:

Today DZone releases my latest refcard on Java GUI Development. It's probably been my most challenging card to write to date, as it provides a reference for both Swing and SWT. Having used both technologies extensively in my time as a Java desktop developer, I thought that it would be worthwhile to have one single reference to use while developing Java rich client applications...

glyphter posted an interesting JavaFX Effect Example:

This is a JavaFX logo that has three-dimensional glowing effect. The Java logo (cofee cup and smoke) is also made in javafx with a glow and lightning effect of javafx. Glow and Lighting are subclasses of abstract base class javafx.scene.effect.Effect...


In the Weblogs, Kohsuke Kawaguchi provides POTD: GitHub API for Java:

My project of the day (or "POTD") is GitHub API for Java — a library for accessing GitHub programmatically. As the Hudson community is embracing plugins developed in Git more and more, I needed to interact with GitHub as a part of the community infrastructure automation. I did a quick Google search to locate existing implementations, but unfortunately I couldn't find anything good. So I decided to just write my own. Thanks to a reasonable API design of GitHub and a good documentation, it was very easy to do so. The trick is to use the right library, which handles most of the JSON/Java databinding...

Fabrizio Giudici posted blueBill Mobile goes Android:

blueBill Mobile has been initially developed for JavaFX and has been blogged about a bit in the past. I already anticipated that a version in JME was in the pipeline; in the meantime, since unfortunately there hasn't been any announce from Oracle about JavaFX for Android phones, I started the development of a specific Android version. It is important also for start involving some users, as I've been unlucky in finding a good number of them able to test JavaFX Mobile applications...

Alexander Schunk posted his first java.net blog since early 2008, JMath a Java API for doing math:

Hello. I would like to introduce JMath project. JMath is math API for doing serious math with Java. With JMath you can do linear algebra, set calculations, general math calculations such as arithmetics, fractions and the like. Also, with JMath you will be able to do serious statistics. Origin of JMath is the former LinAlg API. LinAlg API is part of JMath is now being developed by SysConsult IT Consulting Company...


In the Forums, rsoika asks about JAX-RS in GF 2.1 and EJB injection?: I just started to implement a JAX-RS REST service in GF 3. My implementation need to access EJBs which are deployed in the surrounding EAR of my WAR file. To use the dependency injection (@EJB) I read about the need to add a @stateless...

In the LWUIT forum, majingazetto is working a Problem with BlackBerry Touch Implementation. (Uncaught exception): Hi! I have a problem with the CLDC version (UiApplicacion) for BlackBerry Touch. I have tried two different versions of this implementation and I get the same error: Uncaught exception: java.lang.ClassCastException ...

In the Metro and JAXB forum, latharanjanis has a strange situation where JAXB instance creation takes 8 minutes: Hi All, I am working on a Java desktop application which is installed on a shared drive on the windows server. While creating a JAXB instance from a client machine, it takes around 8 mins to create instances. All the classes are present in the...


Our Spotlight this week is the Java Developer Center on the Oracle Technology Network:

Java is one of the computer industry's best known brands and most widely deployed technologies. Oracle Fusion Middleware is built on Java technology in support of applications and services written in the Java language. With the acquisition of Sun, Oracle will drive continued innovation and investment in Java technology for the benefit of customers and the Java community.


This week's java.net Poll asks What's your reaction to the new cross-platform compiler restrictions in the iPhone Developer Agreement? The poll will be open until Friday.


Our latest Feature Article is Biswajit Sarkar's Using Styles, Themes, and Painters with LWUIT, in which you discover how to use some of the new and enhanced features in LWUIT version 1.3. We're also featuring Dibyendu Roy's Rethinking Multi-Threaded Design Principles, Part 2, which provides guidance on how to harness the processing powere of next generation multicore processors; and HTML5 Server-Push Technologies, Part 1 by Gregor Roth; this two-part series explains the new Server-Sent Events and WebSockets API in HTML5.


Current and upcoming Java Events:

Registered users can submit event listings for the java.net Events Page using our events submission form. All submissions go through an editorial review before being posted to the site.


Archives and Subscriptions: This blog is delivered weekdays as the Java Today RSS feed. Also, once this page is no longer featured as the front page of java.net it will be archived along with other past issues in the java.net Archive.

-- Kevin Farnham

O'Reilly Media
Twitter: @kevin_farnham