代码主题如何代号为一个?

时间:2016-07-08 20:35:16

标签: java codenameone

我是一个真正的初学者,但我想使用代码创建我的移动应用程序的外观。我使用photoshopped图像创建背景,但我想编码按钮和其他所有内容。这就是我所拥有的(我添加的按钮没有显示):

public void start() {
        if(current != null){
            current.show();
            return;
        }
        new StateMachine("/theme");        
    }
    Button customer = new Button("Customer");
    Button gpsAntenna = new Button("Find An Antenna Near You");
    Button learnMore = new Button("Learn More About NEN Now");
    Button nenNow = new Button("NEN Now Webpage");
    public void stop() {
        current = Display.getInstance().getCurrent();
        if(current instanceof Dialog) {
            ((Dialog)current).dispose();
            current = Display.getInstance().getCurrent();
        }
    }

1 个答案:

答案 0 :(得分:1)

您需要将它们添加到表单或容器中。看看Form类和Container类,我认为它们都有一个addComponent()方法。然后,您可能需要重新验证表单才能显示它们。

如果将它们添加到容器中,则需要将其添加到表单中。