私はブラックベリーのアプリケーションで非常に新しいです。
Eclipseを使用してBlackberryで電卓を作成しようとしています:
ボタン(ButtonField
)を追加しました。最初のターゲットは、このボタンを押したときに表示したいことです
「こんにちは.. テキストフィールドで試してみてください。」
ここに私のコードを入れます。
Launcher.java
public class Launcher extends UiApplication {
public static void main(String[] args) {
Launcher theApp = new Launcher();
theApp.enterEventDispatcher();
}
private Launcher()
{
this.pushScreen(new MainScrn());
}
}
MainScrn .java
public class MainScrn extends MainScreen implements FieldChangeListener {
public MainScrn() {
LabelField lf_hello = new LabelField();
lf_hello.setText("Hello, World!");
lf_hello.setBackground(BackgroundFactory.createSolidBackground(124));
ButtonField mySubmitButton = new ButtonField("clickMe");
mySubmitButton.setChangeListener(this);
this.add(lf_hello);
this.add(mySubmitButton);
}
public void fieldChanged(Field field, int context) {
System.out.println("hi.. now you can try with text field");
}
}
こんにちは、これで何が問題なのですか。? 助けてください..あなたにとっては非常に簡単ですが、私は今ではありませんか?