Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import javax.microedition.midlet.MIDlet;
- import javax.microedition.lcdui.CommandListener;
- import javax.microedition.lcdui.Display;
- import javax.microedition.lcdui.Command;
- import javax.microedition.lcdui.Displayable;
- import javax.microedition.lcdui.TextBox;
- public class HolaMidlet extends MIDlet implements CommandListener {
- private Display display;
- private Command cmdExit;
- private TextBox tbxMain;
- // constructor
- public HolaMidlet () {
- display = Display.getDisplay(this);
- cmdExit = new Command(“Exit”,
- Command.EXIT, 1);
- tbxMain = new TextBox( “HelloMidlet”, “Hola mundo movil”, 50, 0);
- tbxMain.addCommand(cmdExit);
- tbxMain.setCommandListener(this);
- }
- public void startApp() {
- display.setCurrent(tbxMain);
- }
- public void pauseApp(){}
- public void destroyApp(boolean unconditional){}
- public void commandAction(Command c, Displayable s) {
- if (c == cmdExit) {
- destroyApp(false);
- notifyDestroyed();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement