貼出我第一個手機Java程式
阿新 • • 發佈:2018-12-30
{
private Display display =null;
public Mobile() {
// TODO 自動生成建構函式存根
}
protectedvoid destroyApp(boolean arg0) throws MIDletStateChangeException {
// TODO 自動生成方法存根
}
protectedvoid pauseApp() {
// TODO 自動生成方法存根
}
protectedvoid startApp() throws MIDletStateChangeException {
//獲得Display例項
display = Display.getDisplay(this);
Form mainForm =new Form("Made by Jack");
Image img =null;
//建立Image物件
try{
img = Image.createImage("/_home_8.png");
}catch(IOException ex){
ex.printStackTrace();
}
if(img !=null)
mainForm.append(img);
String str =new String("/n我的第一個手機Java程式");
mainForm.append(str);
display.setCurrent(mainForm);
}
}
private Display display =null;
public Mobile() {
// TODO 自動生成建構函式存根
}
protectedvoid destroyApp(boolean arg0) throws MIDletStateChangeException {
// TODO 自動生成方法存根
}
protectedvoid pauseApp() {
// TODO 自動生成方法存根
}
protectedvoid startApp() throws MIDletStateChangeException
//獲得Display例項
display = Display.getDisplay(this);
Form mainForm =new Form("Made by Jack");
Image img =null;
//建立Image物件
try{
img = Image.createImage("/_home_8.png");
}catch(IOException ex){
ex.printStackTrace();
if(img !=null)
mainForm.append(img);
String str =new String("/n我的第一個手機Java程式");
mainForm.append(str);
display.setCurrent(mainForm);
}
}