![]() |
|
|
An Introduction to LWUIT for J2ME. |
Post Reply
|
| Author | |
Jijo
Admin Group
Joined: 31 Dec 05 Location: United Kingdom Posts: 495 |
Quote Reply
Topic: An Introduction to LWUIT for J2ME.Posted: 18 Jul 08 at 2:29pm |
|
An Introduction to LWUIT for J2ME.
Sun has released LWUIT (Light Weight UI Toolkit) for Java ME. 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. LWUIT binary library is licensed under Sun License Agreement (SLA), and the source code is licensed under GPLv2. This new project can be viwed at https://lwuit.dev.java.net/ Why LWUIT is important? Writing appealing cross device applications today in Java ME is challenging. Due to implementation differences in fonts, layout, menus the same application may look and behave very differently on different devices. In addition much of the advanced UI functionality is not accessible in LCDUI and requires the developer to write very low level "paint" type code. The Lightweight UI Toolkit was developed to address these issues. The Lightweight UI Toolkit makes it very easy to create compelling UI's that will look and behave the same on all devices using a programming paradigm similar to Swing. This Toolkit is able to run on CLDC1.1 MIDP2.0/CDC PBP/SE. Features of LWUIT Swing Like MVC (Model View Controller) Layouts PLAF (Pluggable Look And Feel) & Themes Fonts Touch Screen Animations & Transitions Rich widgets 3D Integration Painters Modal Dialogs External Tools I18N/L10N Lightweight UI Toolkit supports pluggable theme-ability, a Component and Container hierarchy, and abstraction of the underlying GUI toolkit. An important thing that can be seen is the Touch Screen Support provided. LWUIT project have 2 sub projects associated with it and seems its not officially supported by Sun. lwuit-ext Extension library for LWUIT lwuit-incubator Playground for LWUIT developers The Lightweight UI Toolkit library tries to avoid the "lowest common denominator" mentality by implementing some features missing in the low-end platforms and taking better advantage of high-end platforms. Figure below shows the widget class hierarchy. Getting Started and Using LWUIT with Netbeans 5.5 and 6.0 This explanation says how to get started and use LWUIT with netbeans. First you need to download the LWUIT resource file from https://lwuit.dev.java.net. You can see a link to download page and there you need to accept the agreement and will be allowed to download a zip file. This download includes complete documentation, developer guide, A Demo application that uses LWUIT and shows some of the interesting features that may be of interest.It also come with a Resource editor.The resource editor is a standalone GUI tool that allows UI experts, developers, and translators to open, create, and edit resource packages for LWUIT. The resource editor was designed for visual work and provides live preview of all UI changes, enabling rapid UI customization. And finally you would see the LWUIT.jar file which we need to start with devlopment with LWUIT. On netbean after creating a project add this jar file to resources and you are ready to go. On Netbean 6.1 you can directly add this jar to resource from the project explorer. The Figure looks like below once you have added the correct jar. On 5.5 right click the project and select project properties where you can add the jar to the resources. This can be done on Netbean 6.1. Now you can start using the LWUTI in your project. Try to import com.sun.lwuit.Button; and if its not showing an error that means you are done. I will be coming with more tutorials on LWUIT soon LWUIT is around 225kb without obfuscation, the obfuscation overhead is roughly 100kb for a very heavy application and 50kb for a lighter application. |
|
![]() |
|
Post Reply
|
| Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |