Java by API/javax.microedition.lcdui/Display

Материал из Java эксперт
Версия от 14:49, 31 мая 2010; Admin (обсуждение | вклад) (1 версия)
(разн.) ← Предыдущая | Текущая версия (разн.) | Следующая → (разн.)
Перейти к: навигация, поиск

Display: getDisplay(MIDlet arg0)

  
import javax.microedition.lcdui.Choice;
import javax.microedition.lcdui.Display;
import javax.microedition.lcdui.List;
import javax.microedition.midlet.MIDlet;
public class Main extends MIDlet {
  private String[] capabilitiesIdx = { "microedition.media.version", "supports.mixing",
      "supports.audio.capture", "supports.video.capture", "supports.recording", "audio.encodings",
      "video.encodings", "video.snapshot.encodings", "streamable.contents" };
  public void startApp() {
    List list = new List("Audio/Video Capabilities", Choice.IMPLICIT);
    for (int i = 0; i < capabilitiesIdx.length; ++i) {
      list.append(System.getProperty(capabilitiesIdx[i]) + " - " + capabilitiesIdx[i], null);
    }
    Display.getDisplay(this).setCurrent(list);
  }
  public void pauseApp() {
  }
  public void destroyApp(boolean unconditional) {
  }
}





Display: setCurrent(Displayable nextDisplayable)

  
import javax.microedition.lcdui.Choice;
import javax.microedition.lcdui.Display;
import javax.microedition.lcdui.List;
import javax.microedition.midlet.MIDlet;
public class Main extends MIDlet {
  private String[] capabilitiesIdx = { "microedition.media.version", "supports.mixing",
      "supports.audio.capture", "supports.video.capture", "supports.recording", "audio.encodings",
      "video.encodings", "video.snapshot.encodings", "streamable.contents" };
  public void startApp() {
    List list = new List("Audio/Video Capabilities", Choice.IMPLICIT);
    for (int i = 0; i < capabilitiesIdx.length; ++i) {
      list.append(System.getProperty(capabilitiesIdx[i]) + " - " + capabilitiesIdx[i], null);
    }
    Display.getDisplay(this).setCurrent(list);
  }
  public void pauseApp() {
  }
  public void destroyApp(boolean unconditional) {
  }
}