문제

I am learing to display in Mobile Java application. I came across this example to start with, but it doesn't display anything. I am trying to understand what Display.getDisplay(this) is doing in this code?

import javax.microedition.lcdui.Display;
import javax.microedition.midlet.MIDlet;


public class Midlet extends MIDlet {

    private Display display = null;
    public void startApp() {
        if(display==null)
            display = Display.getDisplay(this);
    }

    public void pauseApp() {
    }

    public void destroyApp(boolean unconditional) {
    }
}
도움이 되었습니까?

해결책

You need to set some displayable to current display like

  Form form = new Form("Hello World");
  String msg = "Hello World!!!!!!!";
  form.append(msg);
  display = Display.getDisplay(this);
  display.setCurrent(form);
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top