Created
September 25, 2016 00:15
-
-
Save pedrogk/590c125f02da48dc115055a7f209658f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment