我是一个真正的初学者,但我想使用代码创建我的移动应用程序的外观。我使用 Photoshop 图像创建背景,但我想对按钮和其他所有内容进行编码。这是我所拥有的(我添加的按钮未显示):
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();
}
}
最佳答案
您需要将它们添加到表单或容器中。看看Form类和Container类,我认为它们都有一个addComponent()方法。然后您可能需要重新验证表单才能让它们显示。
如果将它们添加到容器中,则需要将其添加到表单中。
关于java - 代号一中的代码主题如何?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38274989/