Facebook
From Aha, 5 Years ago, written in Plain Text.
Embed
Download Paste or View Raw
Hits: 241
  1. /*
  2.  * To change this license header, choose License Headers in Project Properties.
  3.  * To change this template file, choose Tools | Templates
  4.  * and open the template in the editor.
  5.  */
  6. package mobileapplication7;
  7.  
  8. import javax.microedition.lcdui.Command;
  9. import javax.microedition.midlet.*;
  10. import javax.microedition.lcdui.CommandListener;
  11. import javax.microedition.lcdui.Display;
  12. import javax.microedition.lcdui.Displayable;
  13. /**
  14.  * @author user
  15.  */
  16. public class Midlet extends MIDlet implements CommandListener
  17. {
  18.     private Plotno plotno;
  19.     private Command cmd;
  20.     private Display ekran;
  21.    
  22.     public Midlet()
  23.     {
  24.         plotno = new Plotno();
  25.         cmd = new Command("Koniec", Command.EXIT, 0);
  26.         plotno.addCommand(cmd);
  27.         plotno.setCommandListener(this);
  28.     }
  29.    
  30.     public void startApp()
  31.     {
  32.         ekran = Display.getDisplay(this);
  33.         ekran.setCurrent(plotno);
  34.     }
  35.      public void pauseApp() { }
  36.      public void destroyApp(boolean u) { }
  37.      
  38.      public void commandAction(Command c, Displayable d)
  39.      {
  40.          if (c == cmd)
  41.          {
  42.              //destroyApp(false);
  43.              notifyDestroyed();
  44.              
  45.          }
  46.              
  47.      }
  48. }