import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;
/**
* @author programmer dekil
*/
public class Midlet extends MIDlet implements CommandListener{
private Display display;
private ChoiceGroup cg1, cg2, cg3;
private Command cmdKeluar;
private Command cmdProses;
private Form form;
private Alert pesan;
public Midlet() {
form = new Form("Lowongan");
cmdKeluar = new Command("Keluar", Command.EXIT, 0);
cmdProses = new Command("Proses", Command.OK, 1);
cg1 = new ChoiceGroup("Posisi", Choice.MULTIPLE);
cg2 = new ChoiceGroup("Pendidikan", Choice.EXCLUSIVE);
cg3 = new ChoiceGroup("Tanggal Lahir", Choice.POPUP);
}
public void addPosisi() {
cg1.append("Programmer", null);
cg1.append("System Analist", null);
cg1.append("GUI Desaingner", null);
cg1.append("Technical Support", null);
form.append(cg1);
}
public void addPend() {
cg2.append("D3 Informatika", null);
cg2.append("S1 Informatika", null);
cg2.append("S2 Teknik", null);
form.append(cg2);
}
public void addTgl() {
cg3.append("1", null);
cg3.append("2", null);
cg3.append("3", null);
cg3.append("4", null);
cg3.append("5", null);
cg3.append("6", null);
cg3.append("7", null);
cg3.append("8", null);
cg3.append("9", null);
cg3.append("10", null);
cg3.append("11", null);
cg3.append("12", null);
form.append(cg3);
}
public void alertShow() {
pesan = new Alert("Informasi", "Data Anda Sedang di Proses", null, AlertType.INFO);
pesan.setTimeout(5000);
display.setCurrent(pesan, form);
}
public void startApp() {
display = Display.getDisplay(this);
addPosisi();
addPend();
addTgl();
form.addCommand(cmdKeluar);
form.addCommand(cmdProses);
form.setCommandListener(this);
display.setCurrent(form);
}
public void pauseApp() {
}
public void destroyApp(boolean unconditional) {
notifyDestroyed();
}
public void commandAction(Command c, Displayable d) {
if (d == form){
if (c == cmdKeluar){
destroyApp(true);
} else if (c == cmdProses) {
alertShow();
}
}
}
}
0 komentar:
Posting Komentar