Contoh Program J2ME (dengan nama project dan MIDlet class: MBankingBisa) LayarJumlahBayar
import javax.microedition.lcdui.*;
public class LayarJumlahBayar
extends Form implements CommandListener {
private MBankingBisa midlet;
private Display display;
private LayarUtama utama;
private LayarPembelian layar3;
private LayarNoHpTujuanBeli hpBeli;
private LayarJumlahBayar jumlahBayar;
private TextField tfJumlahUangBayar;
private Command cmChoice = new Command("Lanjut",Command.SCREEN,1);
private Command cmBack = new Command("Kembali",Command.BACK,0);
public LayarJumlahBayar(MBankingBisa midlet, Display display){
super("Jumlah Pembayaran");
this.midlet= midlet;
this.display = display;
tfJumlahUangBayar = new TextField("Jumlah Uang yang Akan Dibayarkan : ", "",20, TextField.ANY);
append(tfJumlahUangBayar);
addCommand(cmChoice);
addCommand(cmBack);
setCommandListener(this);
}
public void itemStateChanged(Item item) {
}
public void commandAction(Command c, Item item) {
}
public void commandAction (Command c, Displayable d){
if (c == cmChoice){
hpBeli = new LayarNoHpTujuanBeli(midlet,display);
display.setCurrent(hpBeli);
} else if (c == cmBack) {
LayarPembelian layar3 = new LayarPembelian(midlet,display);
display.setCurrent(layar3);
}
}
}
2 comments
gan untuk class :
ReplyDeleteprivate LayarKirimUang layar1;
private LayarTarikUang layar2;
private LayarPembelian layar3;
private LayarPembayaran layar4;
bisa di upload ga, terimakasih :D
oya gan total keseluruhan class nya ada brapa buah ??
ReplyDeletetolong di upload dong buat pembelajaran nih , trimakasih