How to remove MenuBar/ select in lwuit form

98 views Asked by At

I'm trying to remove this select area which shows up as soon as I add a button to my form.

Have attached a screenshot of the same which might help you understand my plight here. I don't want this select area to appear at the bottom of screen.

Please, any suggestion or any pointer would be of great help.

regards.

After adding the button

Below is the code which I'm using.(Xlet project)

public void showMainForm() {
    try {
        mf = new MainForm();
        mf.createMainForm();
        mf.show();
        } catch (Exception e) {
    }
}

public class MainForm extends Form {
MainForm() {
    super();
}
private static Container c;

public void createMainForm() {
    try {
        c = new Container(new CoordinateLayout(800,480));
        Button btn = new Button();
        btn.setX(0); btn.setY(0);
        c.addComponent(btn);
        this.getContentPane().addComponent(c);
    } catch (Exception e) {
    }
}
}

Form code which I tried again...

Form frm = new Form();
frm.getStyle().setBgTransparency(0);
//frm.addComponent(new Button("Button"));
frm.show();
1

There are 1 answers

1
Mun0n On BEST ANSWER

I think that this issue can be solved adding the Command to the Form,not to the Container as you are doing in the attached code.

ADD

I think that I didn't understand what you want to say. Try this code, with my suggestions included

    public void showMainForm() {
        try {
            mf = new MainForm();
            mf.createMainForm();
            mf.show();
            } catch (Exception e) {
        }
    }

    public class MainForm extends Form {
    MainForm() {
        super();
    }
    private static Container c;

    public void createMainForm() {
        try {
            c = new Container(new CoordinateLayout(800,480));
           // Button btn = new Button();
           // btn.setX(0); btn.setY(0);
             // c.addComponent(btn);
           // this.getContentPane().addComponent(c);
           Command c = new Command("command");
           addCommand(c);
        } catch (Exception e) {
        }
    }
    }