//menu utama//
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;
/**
* @author LAB10
*/
public class Menu extends MIDlet implements CommandListener{
Display d;
klassdata ok;
Form f;
StringItem sidata_kuliah, sifoto_ku, siculan_vitae;
Command cmdBack, cmdMasuk;
public Menu()
{
d=Display.getDisplay(this);
cmdBack=new Command("Kembali",Command.BACK,0);
ok=new klassdata(this);
}
public void startApp() {
d.setCurrent(ok);
}
public void pauseApp() {
}
public void destroyApp(boolean unconditional) {
}
void notifyDestroyed(boolean b) {
}
public void tampilkan(){
String data_kuliah;
data_kuliah="mobail progreming";
String foto_ku;
foto_ku="foto-fotoku";
String culan_vitae;
culan_vitae="culan_vitae";
f=new Form("Form Data Diri");
sidata_kuliah=new StringItem("data kuliah :", data_kuliah);
sidata_kuliah.setFont(Font.getFont(Font.FACE_PROPORTIONAL,Font.STYLE_BOLD|Font.STYLE_UNDERLINED,Font.SIZE_MEDIUM));
sifoto_ku=new StringItem("foto foto ku:", foto_ku);
sifoto_ku.setFont(Font.getFont(Font.FACE_PROPORTIONAL,Font.STYLE_BOLD|Font.STYLE_UNDERLINED,Font.SIZE_MEDIUM));
siculan_vitae=new StringItem("culan_vitae:", culan_vitae);
siculan_vitae.setFont(Font.getFont(Font.FACE_PROPORTIONAL,Font.STYLE_BOLD|Font.STYLE_UNDERLINED,Font.SIZE_MEDIUM));
cmdBack=new Command("Kembali",Command.BACK,0);
f.addCommand(cmdBack);
f.append(sidata_kuliah);
f.append(sifoto_ku);
f.append(siculan_vitae);
f.setCommandListener(this);
f.addCommand(cmdBack);
f.setCommandListener(ok);
d.setCurrent(f);
}
public void commandAction(Command c, Displayable x) {
}
}
//klassdata //
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
/**
*
* @author LAB10
*/
import javax.microedition.lcdui.*;
import javax.microedition.midlet.*;
public class klassdata extends Canvas implements CommandListener{
Menu menu;
Command cmdKeluar, cmdMasuk;
Image img;
public klassdata(Menu tampilan){
this.menu=tampilan;
cmdKeluar=new Command("Keluar",Command.EXIT, 0);
cmdMasuk=new Command("Masuk",Command.OK, 1);
cmdMasuk=new Command("Masuk",Command.OK, 2);
addCommand(cmdKeluar);
addCommand(cmdMasuk);
setCommandListener(this);
}
public void paint(Graphics g) {
g.setColor(0,255,0);
g.fillRect(0, 0, getWidth(), getHeight());
g.setColor(0, 0, 0);
g.drawString("Quis", 120,5, Graphics.HCENTER|Graphics.TOP);
g.setColor(255, 0, 0);
g.drawString("UNIVERSITAS PUTRA INDONESIA", 50,15, Graphics.HCENTER|Graphics.TOP);
g.setColor(0, 0, 255);
g.drawString("KELAS IF_2", 100,200, Graphics.HCENTER|Graphics.TOP);
g.setColor(0, 255, 0);
g.drawString("TEKNIK INFORMATIKA", 95,210, Graphics.HCENTER|Graphics.TOP);
g.setColor(255, 255, 0);
g.drawString("FAKULTAS ILMU KOMPUTER", 90,220, Graphics.HCENTER|Graphics.TOP);
g.setColor(0, 255, 255); // biru
g.drawString("---anjar dwiyono k---", 70,230, Graphics.HCENTER|Graphics.TOP);
g.drawRect(0,250,250,5);
try {
Image image = Image.createImage("/0001.jpg");
g.drawImage(image,120,30,Graphics.HCENTER | Graphics.TOP);
} catch (Exception e){}
try {
Image image = Image.createImage("/001.jpg");
g.drawImage(image,20,100,Graphics.HCENTER | Graphics.TOP);
} catch (Exception e){}
try {
Image image = Image.createImage("/002.jpg");
g.drawImage(image,180,100,Graphics.HCENTER | Graphics.TOP);
} catch (Exception e){}
}
public void commandAction(Command c, Displayable z) {
if(c==cmdKeluar){
menu.destroyApp(true);
menu.notifyDestroyed(true);
}else if(c==cmdMasuk){
menu.tampilkan();
}else if(c==menu.cmdMasuk){
menu.d.setCurrent(menu.ok);
}
}
}
Tidak ada komentar:
Posting Komentar
berikan komentar anda tentang blog saya?