0

この質問をする前に、ここで答えを検索しましたが、見つかりませんでした。私の悪い英語で申し訳ありませんが、それは私の母国語ではありません.

これが私の問題です:

リソース エディターから生成された LWUIT 1.5 アプリを Netbeans に作成しました。VirtualKeyboard を独自のボタンでカスタマイズし、それらを TextField にバインドしたいのですが、コードを配置する場所がわかりません。私はそれをBeforeShow my Form "MyForm"、またはPostShowに次のように入れてみました:

protected void beforeMyForm(Form f) {
   // If the resource file changes the names of components this call will break notifying you that you should fix the code
super.beforeMyForm(f);

VirtualKeyboard vkb = new VirtualKeyboard();

//I declared the new input
String[][] CALC_NUM = new String[][]{
        {"1", "3", "5",},
        {"7", "9", "0",},
        {".","$OK$"}
};
//Added the new input mode
vkb.addInputMode("137_C", CALC_NUM);
vkb.setInputModeOrder(new String[]{"137_C"});

//Bind the vkb to my TextField
VirtualKeyboard.bindVirtualKeyboard(findTfCalc(Display.getInstance().getCurrent()), vkb);

}

beforeShow には NullPointerException があり、postShow には何も起こりません。

TextField のプロパティでは、制約は数値です。Numeric および Password 制約にバグがあることは知っていますが、TextField に ANY 制約を与えようとしましたが、機能しません。

誰か手を貸してくれませんか?Codenameoneでも同じでしょうか?どうもありがとう。

4

1 に答える 1