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) {
}
}
}