import javax.microedition.lcdui.*; class Loading extends Canvas implements Runnable { private GameMidlet midlet = null; private volatile Thread thread = null; private Image image = null; Loading(GameMidlet midlet) { this.midlet = midlet; try { image = Image.createImage("/Loading.png"); } catch(Exception ex) { System.err.println("Loading.png not founddd"); } setFullScreenMode(true); } public void start() { thread = new Thread (this); thread.start(); } public void run() { synchronized(this) { try { midlet.newGame(); } catch(Exception ex) { System.out.println(ex); } } } public void stop() { thread = null; System.gc(); } public void paint (Graphics graphics) { graphics.setColor(ffffff); graphics.fillRect(0, 0, getWidth(), getHeight()); graphics.drawImage(image, getWidth()/2, getHeight()/2, Graphics.VCENTER|Graphics.HCENTER); } }