Chinaunix首页 | 论坛 | 博客
  • 博客访问: 100851
  • 博文数量: 52
  • 博客积分: 2095
  • 博客等级: 大尉
  • 技术积分: 500
  • 用 户 组: 普通用户
  • 注册时间: 2008-04-08 13:29
文章分类

全部博文(52)

文章存档

2010年(1)

2009年(24)

2008年(27)

我的朋友

分类: Java

2008-06-04 17:38:21

对于不同的游戏,在MainCanvas类中添加代码即可。

import javax.microedition.lcdui.Display;
import javax.microedition.midlet.MIDlet;
import javax.microedition.midlet.MIDletStateChangeException
public class PuzzleMidlet extends MIDlet {

    private static MainCanvas m_MainCanvas;
    public PuzzleMidlet() {
        super();
        // TODO Auto-generated constructor stub

    }

    protected void startApp() throws MIDletStateChangeException {
        // TODO Auto-generated method stub

        if (m_MainCanvas == null)
        {
            try
            {
                m_MainCanvas = new MainCanvas(this);
                
         }
            catch (Exception ex)
            {
             System.out.println(ex);
         }
        }
        Display.getDisplay(this).setCurrent(m_MainCanvas);

    }

  
    protected void pauseApp() {
        // TODO Auto-generated method stub
            m_MainCanvas.stop();
    }


    protected void destroyApp(boolean arg0) throws MIDletStateChangeException {
        // TODO Auto-generated method stub
            m_MainCanvas.stop();
    }

}

阅读(506) | 评论(0) | 转发(0) |
0

上一篇:装上了GTALK

下一篇:就是喜欢IDE

给主人留下些什么吧!~~