Search code examples
java-melwuitgui-builder

How to include a user component to LWUIT 1.5 GUI Builder?


I'd like to have any Form managed through the StateMachine generated from LWUIT's 1.5 GUI Builder but I have my component which extends Components and also my own Layouts. How to add them to gui builder as custom Component?


Solution

  • You have two ways. The first override:

       protected Component createComponentInstance(String componentType, Class cls)
    

    Which allows you to replace all components of a given type (E.g. make your own subclass for all the forms).

    The second option is to add them at runtime.

    We used to allow used components using the pickMIDlet functionality but that's a bit problematic since a user class might not be compilable while editing a res file.