Click here to Skip to main content
13,624,563 members
Rate this:
 
Please Sign up or sign in to vote.
See more:
for example, this
Command exitCommand;
  exitCommand = new Command("Exit", Command.SCREEN, 2);
  addCommand(exitCommand);

into this:

package MyGame;
import java.util.*;
import javax.microedition.lcdui.game.GameCanvas;
import javax.microedition.lcdui.game.Sprite;
import javax.microedition.lcdui.*;
///////

import javax.microedition.io.*;
import java.io.*;

public class clsCanvas extends GameCanvas implements Runnable {

    private boolean isRunning = true;
    private Graphics g;
    private midMain fParent;

    ////////
    public Sprite cursor;
    public GameDesign gameDesign;
    ////
public int step = 10;
///...variables[trimmed]


    public clsCanvas(midMain m) {
        super(true);
        fParent = m;
    }

        public void start(){
        Thread runner = new Thread(this);
        runner.start();
    }
    public void run() {



    g = getGraphics();

        while (isRunning) {
            iKey = getKeyStates();
 ///listening keyboard[trimmed]

        }
        try{
        Thread.sleep(30);
            }
        catch(Exception ex){}
        }



        g = null;
       fParent.destroyApp(false);
       fParent = null;
    }

}

Please, help.
Posted 16-Sep-10 11:42am
Updated 16-Sep-10 11:44am
v3
Comments
halabella 17-Sep-10 16:44pm
   
Solved.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Cookies | Terms of Service
Web02-2016 | 2.8.180712.1 | Last Updated 16 Sep 2010
Copyright © CodeProject, 1999-2018
All Rights Reserved.
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100