Goodbye World
/* MIDlet-Name: Hello World MIDlet-Version: 1.0 MIDlet-Vendor: Jim MIDlet-Description: My First MIDlet suite MIDlet-1: HelloWorld, /greeting/myLogo.png, greeting.HelloWorld MIDlet-2: GoodbyeWorld, /greeting/myLogo.png, greeting.GoodbyeWorld MIDlet-Jar-URL: HelloWorld.jar MIDlet-Jar-Size: 4048 */ import javax.microedition.lcdui.Command; import javax.microedition.lcdui.CommandListener; import javax.microedition.lcdui.Display; import javax.microedition.lcdui.Displayable; import javax.microedition.lcdui.TextBox; import javax.microedition.midlet.MIDlet; public class GoodbyeWorld extends MIDlet implements CommandListener { private Display display; private TextBox textBox = new TextBox("Goodbye World", "My second MIDlet", 40, 0); private Command quitCommand = new Command("Quit", Command.SCREEN, 1); public void startApp() { display = Display.getDisplay(this); textBox.addCommand(quitCommand); textBox.setCommandListener(this); display.setCurrent(textBox); } public void pauseApp() { } public void destroyApp(boolean unconditional) { } public void commandAction(Command choice, Displayable displayable) { if (choice == quitCommand) { destroyApp(false); notifyDestroyed(); } } }
1. | Example MIDlet | ||
2. | Hello Midlet | ||
3. | Simple Midlet Demo | ||
4. | Basic MIDlet Shell | ||
5. | Welcome MIDlet | ||
6. | Welcome Back | ||
7. | Example jad file | ||
8. | MIDlet lifecycle | ||
9. | MIDlet State Transitions |