Program Java Mobile Menampilkan Ticker dan Gambar Politeknik Negeri Sriwijaya
mport java.io.IOException;import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;
public class CobaMidlet extends MIDlet implements CommandListener {
private Display display;
private Form form, login;
private Ticker ticker;
private Command Start, exit, back;
private Image img;
private ImageItem img2;
private TextField tf_Username;
private TextField tf_Password;
public CobaMidlet(){
form = new Form("");
ticker=new Ticker("SELAMAT DATANG DI POLITEKNIK NEGERI SRIWIJAYA PALEMBANG");
form.setTicker(ticker);
try {
img = Image.createImage("/graha.jpg");
img2 = new ImageItem("Jl. Srijaya Negara Bukit Besar 30139 Telpon:+620711353414 Fax:+62711355918 www.polsri.ac.id", img,ImageItem.LAYOUT_CENTER,"");
form.append(img2);
form.setCommandListener(this);
Start = new Command("Start", Command.OK,1);
exit = new Command("Exit", Command.OK,1);
form.addCommand(Start);
form.addCommand(exit);
} catch (IOException e){
System.out.println("error"+e);
}
}
public void startApp(){
display=Display.getDisplay(this);
display.setCurrent(form);
}
public void pauseApp(){
}
public void destroyApp(boolean unconditional){
notifyDestroyed();
}
public void commandAction(Command c , Displayable dd){
if (c==exit)
destroyApp(true);
else if (c==Start)
display.setCurrent(form);
}
}
Hasilnya :
0 komentar:
Posting Komentar