Advertisement
Guest User

Untitled

a guest
Sep 24th, 2016
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.97 KB | None | 0 0
  1. import javax.microedition.midlet.MIDlet;
  2. import javax.microedition.lcdui.CommandListener;
  3. import javax.microedition.lcdui.Display;
  4. import javax.microedition.lcdui.Command;
  5. import javax.microedition.lcdui.Displayable;
  6. import javax.microedition.lcdui.TextBox;
  7.  
  8. public class HolaMidlet extends MIDlet implements CommandListener {
  9. private Display display;
  10. private Command cmdExit;
  11. private TextBox tbxMain;
  12.  
  13. // constructor
  14. public HolaMidlet () {
  15. display = Display.getDisplay(this);
  16. cmdExit = new Command(“Exit”,
  17. Command.EXIT, 1);
  18. tbxMain = new TextBox( “HelloMidlet”, “Hola mundo movil”, 50, 0);
  19. tbxMain.addCommand(cmdExit);
  20. tbxMain.setCommandListener(this);
  21. }
  22.  
  23. public void startApp() {
  24. display.setCurrent(tbxMain);
  25. }
  26.  
  27. public void pauseApp(){}
  28.  
  29. public void destroyApp(boolean unconditional){}
  30.  
  31. public void commandAction(Command c, Displayable s) {
  32. if (c == cmdExit) {
  33. destroyApp(false);
  34. notifyDestroyed();
  35. }
  36. }
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement