Wednesday, December 8, 2010

LWUIT Resource Editor Tutorial Part 6: Lists & Renderers

In this part of the tutorial I go over the basic ideas behind lists & cell renderers. Lists in the GUI builder have most of the power that they have within LWUIT proper including renderers and models, with some simplifications in place.


  1. Hey Shai,

    I'm on Kubuntu 64 bit (using 32 bit java), and I can't get the "Gui builder" part of Resource Editor to work. Themes and other stuff seems to be ok.

    Any ideas? Do you have any plans for a stand-alone version (not ws) that includes the Gui stuff?

    I'm trying to port an old Swing app to phone, and LWUIT looks exactly like what I need. Good Work.


  2. Yes, I plan to start releasing builds in the SVN as well. You can run JWS with the console and see the error you are getting and open an issue on me in the LWUIT issue tracker.
    Its probably a native look and feel issue, to workaround it just change the resource editor theme to Java look and feel.

    1. hy shai, I can ask LWUIT master file, I want to learn it. I want to sit with you

      My email :

  3. Hi Shay,

    What would you do if you had a list of objects at runtime that you would like to map on the renderer you built in the resource editor?

    Thank you,

  4. Hi,

    How can i set Command on ListItem.
    i want make it on Resource editor.

  5. @Victor: I override setModel and instantiate the data. We are working with an ISV who has built a pretty huge app in the GUI builder (videos coming soon) and all of his data is completely dynamic. All of the UI and most of the navigation is from the GUI builder.

    @emehmet: This can be done in code (e.g. using the method above or a similar approach). Currently the GenericListCellRenderer supports navigation data but not commands as entries. So the GUI doesn't support it yet either. Its in my very long "todo" list ;-)

  6. When i click Screen Command on Resource editor its worked but i get Null Pointer Exception Error when i click on Netbeans Emulator or Cell phone. Thank You.

  7. I intend to publish additional tutorials but with all the work it might take some time...
    I have no idea why a command will work in the editor and not in the emulator. Make sure you are using the latest of both LWUIT and the editor a stack trace might help.
    You can also debug the code pretty easily against the LWUIT sources.

  8. Hello that such, I'm watching your tutorials on the new version of LWUIT editor, based principally new "UI ", but I'm not clear how to use creativity in the code.
    I have also questioned whether the design as "UI" I can use it dynamically, or is it just for static.
    For example I want to create a button that has a superior picture and below the image are lines of text, I can create this object and then load the data programmatically "dynamic. "
    You will have some direction where I can download sample code.
    From already thank you very much.

    my e-mail:

  9. Just place a container in the GUI builder hierarchy. Then click the beforeShow button in the event tab.
    Use findMyContainerName(root) to locate your container and just add/remove any component you wish. The LWUIT component-container hierarchy is the same as always and you can modify it in runtime without a problem.

  10. You are unclear on what isn't working?
    Is source generated, is the event invoked? Have you tried debugging the generated code to see what is going on?