문제

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?

도움이 되었습니까?

해결책

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.

다른 팁

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top