【Java开源代码栏目提醒】:网学会员为需要Java开源代码的朋友们搜集整理了TickerDemo.java相关资料,希望对各位网友有所帮助!
import javax.microedition.lcdui.*;
import javax.microedition.midlet.MIDlet;
public class TickerDemo extends MIDlet implements CommandListener {
private static final String TICKER_TEXT = "白日依山尽黄河入海流欲穷千里目更上一层楼";
private Command exitCommand = new Command("Exit", Command.EXIT, 1);
private Form mainForm;
public TickerDemo() {
mainForm = new Form("Ticker
演示");
Ticker t = new Ticker(TICKER_TEXT);
mainForm.setTicker(t);
mainForm.addCommand(exitCommand);
mainForm.setCommandListener(this);
}
protected void startApp() {
Display.getDisplay(this).setCurrent(mainForm);
}
public void commandAction(Command c, Displayable s) {
if (c == exitCommand) {
destroyApp(false);
notifyDestroyed();
}
}
protected void destroyApp(boolean unconditional) {
}
protected void pauseApp() {
}
}