gpt4 book ai didi

java - LWUIT 获取组合框选择

转载 作者:行者123 更新时间:2023-12-01 14:08:51 24 4
gpt4 key购买 nike

我是 LWUIT 的 nwebie。我使用资源编辑器创建了一个主题并生成了一个代码。在表单中,用户选择县,然后按继续命令。如何获取用户使用命令选择的内容以及如何在获取用户国家/地区后显示下一个表单?我之前没有使用过 StateMachine.java 和 StateMachineBase.Java 下面是我的命令代码,但我不知道要调用什么。

    package userclasses;

import com.sun.lwuit.Container;
import generated.StateMachineBase;


public class StateMachine extends StateMachineBase {

public StateMachine(String resFile) {
super(resFile);
// do not modify, write code in initVars and initialize class members there,
// the constructor might be invoked too late due to race conditions that might occur
}

/**
* this method should be used to initialize variables instead of the
* constructor/class scope to avoid race conditions
*/
protected void initVars() {

String username;
}

protected boolean onGetUserCountryFormContinue() {
// If the resource file changes the names of components this call will break notifying you that you should fix the code
boolean val = super.onGetUserCountryFormContinue();
//I should get the user selection here after the command has been selected.

return val;
}
}

最佳答案

我建议迁移到Codename One哪个得到更好的支持。

使用类似的东西:

 int selectedIndex = findMyComboBoxName().getSelectedIndex();
Object selectedValue = findMyComboBoxName().getSelectedItem();

关于java - LWUIT 获取组合框选择,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18692384/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com