Tugas2 – Suci Dewi


import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;
public class SuciDewi extends MIDlet implements CommandListener {
Display display = null;
List menu = null;
Form imageForm;
Ticker ticker= new Ticker(“Hijau Daun Suara…Ku Berharap…”);
static final Command backCommand = new Command(“Back”, Command.BACK, 0);
static final Command mainMenuCommand = new Command(“OK”, Command.SCREEN, 1);
static final Command exitCommand = new Command(“Out”, Command.STOP, 2);
String currentMenu = null;

public SuciDewi(){
}
public void startApp()throws MIDletStateChangeException {
Ticker ticker= new Ticker(“uchie’s data,,,”);
display = Display.getDisplay(this);
menu = new List(“Choice Menu”,Choice.IMPLICIT);
menu.append(“saya”,null);
menu.append(“jedi”,null);
menu.append(“aq”,null);
menu.addCommand(exitCommand);
menu.setCommandListener(this);
menu.setTicker(ticker);
mainMenu();

}

public void pauseApp() {
}
public void destroyApp(boolean unconditional) {
notifyDestroyed();
}
void mainMenu() {
display.setCurrent(menu);
currentMenu = “Main”;
}
public void imageForm1()
{
imageForm = new Form(“Album Foto”);
imageForm.addCommand(backCommand);
imageForm.setCommandListener(this);

try {
Image img = Image.createImage(“/uci.jpg”);
ImageItem image =    new ImageItem(“Uchie myutttzzz,,”, img, Item.LAYOUT_CENTER, “Foto”);
imageForm.append(image);
} catch (Exception e){e.printStackTrace();} display.setCurrent(imageForm);

}
public void imageForm2() {
imageForm = new Form(“Album Foto”);
imageForm.addCommand(backCommand);
imageForm.setCommandListener(this);

try {
Image img = Image.createImage(“/jedi.jpg”);
ImageItem image =    new ImageItem(“Siapa nich,,,”, img, Item.LAYOUT_CENTER, “Foto”);
imageForm.append(image);
} catch (Exception e){e.printStackTrace();} display.setCurrent(imageForm);

}
public void imageForm3() {
imageForm = new Form(“Album Foto”);
imageForm.addCommand(backCommand);
imageForm.setCommandListener(this);

try {
Image img = Image.createImage(“/suci.jpg”);
ImageItem image =    new ImageItem(“myutttt abiez,,”, img, Item.LAYOUT_CENTER, “Foto”);
imageForm.append(image);
} catch (Exception e){e.printStackTrace();} display.setCurrent(imageForm);

}
public void commandAction(Command c, Displayable d) {
String label = c.getLabel();
if (label.equals(“Out”)) {destroyApp(true);
} else if (label.equals(“Back”)) { mainMenu ();
} else { List down = (List)display.getCurrent();
switch(down.getSelectedIndex()) {
case 0: imageForm1();break;
case 1: imageForm2();break;
case 2: imageForm3();break; } } } }

2 thoughts on “Tugas2 – Suci Dewi

Tinggalkan Balasan

Isikan data di bawah atau klik salah satu ikon untuk log in:

Logo WordPress.com

You are commenting using your WordPress.com account. Logout / Ubah )

Gambar Twitter

You are commenting using your Twitter account. Logout / Ubah )

Foto Facebook

You are commenting using your Facebook account. Logout / Ubah )

Foto Google+

You are commenting using your Google+ account. Logout / Ubah )

Connecting to %s