/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;
/**
* @author Acer
*/
public class SurveiPresiden extends MIDlet implements CommandListener {
Display display;
Form choiceForm;
Command exitCommand = new Command ("Exit",Command.EXIT,1);
ChoiceGroup choiceExclusive, choiceMultiple, choicePopup;
public SurveiPresiden(){
choiceForm = new Form("CAPRES-CAWAPRES 2014 - 2019");
choiceForm.addCommand(exitCommand);
choiceForm.setCommandListener(this);
choiceExclusive = new ChoiceGroup("Pilih Presiden", Choice.EXCLUSIVE);
choiceExclusive.append("Aburizal Bakrie", null);
choiceExclusive.append("Jokowi", null);
choiceExclusive.append("Prabowo", null);
choiceExclusive.append("Wiranto", null);
choiceForm.append(choiceExclusive);
choiceMultiple = new ChoiceGroup("Pilih Wakil Presiden", Choice.MULTIPLE);
choiceMultiple.append("Otto", null);
choiceMultiple.append("Rizma", null);
choiceMultiple.append("Subianto", null);
choiceMultiple.append("Hary Tanoe", null);
choiceForm.append(choiceMultiple);
choicePopup = new ChoiceGroup("Partai", Choice.POPUP);
choicePopup.append("Golkar", null);
choicePopup.append("PDIP", null);
choicePopup.append("Gerindra", null);
choicePopup.append("Hanura", null);
choiceForm.append(choicePopup);
}
public void startApp() {
if (display == null){
display = Display.getDisplay(this);
display.setCurrent(choiceForm);
}
}
public void pauseApp() {
}
public void destroyApp(boolean unconditional) {
}
public void commandAction(Command c, Displayable d){
if (c == exitCommand){
destroyApp(true);
notifyDestroyed(); // Exit
}
}
}
Selamat Mencoba ............... :D
Tidak ada komentar:
Posting Komentar