C:\eclipse\workspace\SimplePong\src\PongMIDlet.java
 1 /**
 2  * PongMIDlet contains the basic MIDlet class for a simple Pong game
 3  *
 4  * Simple Pong is available for non-commercial use only!
 5  * 
 6  * @author      Ziga Hajdukovic
 7  * @version     1.0
 8  */
 9 
10 import javax.microedition.midlet.*;
11 import javax.microedition.lcdui.*;
12 
13 public class PongMIDlet extends MIDlet
14 {
15         public PongMIDlet()
16         {
17         }
18 
19         public void startApp()
20         {
21                 PongCanvas pongCanvas = new PongCanvas(this);
22                 Display.getDisplay(this).setCurrent(pongCanvas);
23             try {
24                 // Start the game in its own thread
25                 Thread myThread = new Thread(pongCanvas);
26                 myThread.start();
27             } catch (Error e) {
28                 destroyApp(false);
29                 notifyDestroyed();
30             } 
31         }
32 
33         public void pauseApp()
34         {
35         }
36 
37         public void destroyApp(boolean b)
38         {
39         }
40 
41         void exitRequested()
42         {
43                 destroyApp(false);
44                 notifyDestroyed();
45         }
46 }
47