Search code examples
lwuitcodenameone

How to call an alerady made Form with CodeNameOne with the code ligen clicking on a button


i want to call a form already designed with CodeNAmeOne and call it with

protected void onConnexion_Button1Action(Component c, ActionEvent event) {
    TextField tf1 = findTextField(Display.getInstance().getCurrent());
    String email = tf1.getText();
    if(email.equals("client")){
        Form f;
        f.show();
    }

but didnt find how to call the form i want from the design i can get teh components but not the form please i need the answer soon


Solution

  • Use:

    showForm("MyFormName");
    

    This can be useful:

    http://www.codenameone.com/how-do-i---handle-eventsnavigation-in-the-gui-builder--populate-the-form-from-code.html