문제

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();
도움이 되었습니까?

해결책

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) {
        }
    }
    }
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top