Lowongan kerja internet, Anda dibayar setiap survei, syarat: bisa internet. Informasi selengkapnya

Materi Ke nol


.

Dalam Materi Ke Nol
saya belajar menampilkan "Hallo J2ME", dengan menggunakan Command EXIT
=============================================================================
import java.microedition.midlet.*;
import java.microedition.lcdui.*;

public class coba extends Midlet implements CommandListener{
private Command exitcmd;
private Display display;

public teks() {
display= Display.getdisplay(this);
exitcmd=Command("Exit",Command.Screen,1);
}
public void StartApp() {
textbox teks=Textbox("Teks","Hallo J2ME",20,0);
teks.AddCommand(exitcmd);
teks.setcommand(this);
display.setcurrent(teks);
}

public void pauseApp() {}
public destroyApp(boolean unconditional) {}

public void commandAction(Command c,Displayable s)
{
if (c==exitcommand) {
destroyApp(false);
} notifyDestroyed;
}
}
=======================================================================