Question

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?

Was it helpful?

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.

OTHER TIPS

You must create them in the GUI builder, you can't export your own Componentfrom code to the GUI Builder. Build them in the Gui Builder and if this component is a Container you can create instance of this usign StateMachine.createContainer(resource, "nameContainer");. To manage the Formsthrough the StateMachine, you can use StatMachine.showForm("nameForm"); to show a Form and StateMachine.back() to go back in the navigation.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top