검은 딸기 응용 프로그램에서 매우 새로운입니다. blackberry ButtonField 응용 프로그램 샘플
이제 블랙 베리 사용하여 Eclipse에서 계산기를 만들려고 : 그래서 난 버튼 (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는
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");
}
}
안녕하세요을 된 .java 무슨 일이에 대한 잘못된. ? pls 도움 .. 그것은 당신을 위해 아주 간단합니다,하지만 지금은 아니야?