import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;
public class TickerSederhana extends MIDlet
implements CommandListener {
private Display display;
private Form form;
private Ticker ticker;
private StringItem si;
private String teksTicker =
"Pesan yang dimunculkan sebagai ticker...";
private String isiLayar =
"Aplikasi ini menunjukkan bagaimana cara " + "Membuat ticker sederhana";
private final Command cmdKeluar =
new Command("Keluar", Command.EXIT, 1);
public TickerSederhana() {
display = Display.getDisplay(this);
}
public void startApp() {
form = new Form("Ticker Sederhana");
ticker = new Ticker(teksTicker);
form.setTicker(ticker);
si = new StringItem(null, isiLayar);
form.append(si);
form.addCommand(cmdKeluar);
form.setCommandListener(this);
display.setCurrent(form);
}
public void pauseApp() {
}
public void destroyApp(boolean unconditional) {
}
public void commandAction(Command c, Displayable s) {
if (c == cmdKeluar) {
destroyApp(false);
notifyDestroyed();
}
}
}
import javax.microedition.lcdui.*;
public class TickerSederhana extends MIDlet
implements CommandListener {
private Display display;
private Form form;
private Ticker ticker;
private StringItem si;
private String teksTicker =
"Pesan yang dimunculkan sebagai ticker...";
private String isiLayar =
"Aplikasi ini menunjukkan bagaimana cara " + "Membuat ticker sederhana";
private final Command cmdKeluar =
new Command("Keluar", Command.EXIT, 1);
public TickerSederhana() {
display = Display.getDisplay(this);
}
public void startApp() {
form = new Form("Ticker Sederhana");
ticker = new Ticker(teksTicker);
form.setTicker(ticker);
si = new StringItem(null, isiLayar);
form.append(si);
form.addCommand(cmdKeluar);
form.setCommandListener(this);
display.setCurrent(form);
}
public void pauseApp() {
}
public void destroyApp(boolean unconditional) {
}
public void commandAction(Command c, Displayable s) {
if (c == cmdKeluar) {
destroyApp(false);
notifyDestroyed();
}
}
}
0 komentar:
Posting Komentar