Listing Program :
import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;
public class fotokeluargaa extends MIDlet implements CommandListener {
Form f1,f2,f3,f4;
Display layar;
Command keluar,kembali1,kembali2,kembali3,kembali4;
Ticker t;
List list_menu;
public fotokeluargaa(){
t = new Ticker ("FOTO KELUARGA");
keluar = new Command ("Keluar",Command.EXIT,0);
list_menu = new List("Data Keluarga",List.IMPLICIT);
try {
Image ayah = Image.createImage("/ayah.jpg");
Image ibu = Image.createImage("/ibu.jpg");
Image saya = Image.createImage("/saya.jpg");
list_menu.append("ayah", ayah);
list_menu.append("ibu", ibu);
list_menu.append("saya", saya);
list_menu.append("semua",null);
list_menu.addCommand(keluar);
list_menu.setTicker(t);
list_menu.setCommandListener(this);
Image satu = Image.createImage("/ayah.jpg");
ImageItem tampil = new ImageItem ("ayah",satu,Item.LAYOUT_CENTER,"Ket");
kembali1 = new Command ("Back",Command.BACK,0);
t = new Ticker ("FOTO KELUARGA");
f1 = new Form("Foto Ayah");
f1.append(tampil);
f1.addCommand(kembali1);
f1.setTicker(t);
f1.setCommandListener(this);
Image dua = Image.createImage("/ibu.jpg");
ImageItem tampil2 = new ImageItem ("ibu",dua,Item.LAYOUT_CENTER,"Ket");
kembali2 = new Command ("Back",Command.BACK,0);
t = new Ticker ("FOTO KELUARGA");
f2 = new Form("Foto Ibu");
f2.append(tampil2);
f2.addCommand(kembali2);
f2.setTicker(t);
f2.setCommandListener(this);
Image tiga = Image.createImage("/saya.jpg");
ImageItem tampil3 = new ImageItem ("saya",tiga,Item.LAYOUT_CENTER,"Ket");
kembali3 = new Command ("Back",Command.BACK,0);
t = new Ticker ("FOTO KELUARGA");
f3 = new Form("Foto Saya");
f3.append(tampil3);
f3.addCommand(kembali3);
f3.setTicker(t);
f3.setCommandListener(this);
Image lagi1 = Image.createImage("/ayah.jpg");
ImageItem luas = new ImageItem ("ayah",lagi1,Item.LAYOUT_TOP,"Ket");
Image lagi2 = Image.createImage("/ibu.jpg");
ImageItem luar = new ImageItem ("ibu",lagi2,Item.LAYOUT_VSHRINK,"Ket");
Image lagi3 = Image.createImage("/saya.jpg");
ImageItem luak = new ImageItem ("saya",lagi3,Item.LAYOUT_LEFT,"Ket");
kembali4 = new Command ("Back",Command.BACK,0);
t = new Ticker ("FOTO KELUARGA");
f4 = new Form("Foto Semua?");
f4.append(luas);
f4.append(luar);
f4.append(luak);
f4.addCommand(kembali4);
f4.setTicker(t);
f4.setCommandListener(this);
}catch (Exception ex){
}
}
public void startApp() {
layar = Display.getDisplay(this);
layar.setCurrent(list_menu);
}
public void pauseApp() {
}
public void destroyApp(boolean unconditional) {
}
public void commandAction(Command C, Displayable arg1) {
if(C==keluar){
destroyApp(true);
notifyDestroyed();
}
if (C==kembali1){
layar.setCurrent(list_menu);
}
if (C==kembali2){
layar.setCurrent(list_menu);
}
if (C==kembali3){
layar.setCurrent(list_menu);
}
if (C==kembali4){
layar.setCurrent(list_menu);
}
if(C==List.SELECT_COMMAND){
int i=list_menu.getSelectedIndex();
String S =list_menu.getString(i);
if(S=="ayah"){
layar.setCurrent(f1);
}
if(C==List.SELECT_COMMAND){
int p=list_menu.getSelectedIndex();
String P =list_menu.getString(p);
if(P=="ibu"){
layar.setCurrent(f2);
}
if(C==List.SELECT_COMMAND){
int j=list_menu.getSelectedIndex();
String J =list_menu.getString(j);
if(J=="saya"){
layar.setCurrent(f3);
}
if(C==List.SELECT_COMMAND){
int q=list_menu.getSelectedIndex();
String Q =list_menu.getString(q);
if(Q=="semua"){
layar.setCurrent(f4);
}
}
}
}
}
}
}