Main.java
资源名称:J2ME&Game.rar [点击查看]
上传用户:gyyuli
上传日期:2013-07-09
资源大小:3050k
文件大小:2k
源码类别:
J2ME
开发平台:
Java
- /*****************************************************************************
- Description: Creates a M3GCanvas that rotates a 3D triangle on the screen.
- @file Main.java
- COPYRIGHT All rights reserved Sony Ericsson Mobile Communications AB 2004.
- The software is the copyrighted work of Sony Ericsson Mobile Communications AB.
- The use of the software is subject to the terms of the end-user license
- agreement which accompanies or is included with the software. The software is
- provided "as is" and Sony Ericsson specifically disclaim any warranty or
- condition whatsoever regarding merchantability or fitness for a specific
- purpose, title or non-infringement. No warranty of any kind is made in
- relation to the condition, suitability, availability, accuracy, reliability,
- merchantability and/or non-infringement of the software provided herein.
- *****************************************************************************/
- import javax.microedition.midlet.*;
- import javax.microedition.lcdui.*;
- import javax.microedition.lcdui.game.*;
- import javax.microedition.m3g.*;
- public class Main extends MIDlet implements CommandListener{
- private Command ExitCommand;
- private Display d;
- private M3GCanvas m3gCanvas;
- public Main(){
- d = Display.getDisplay(this);
- ExitCommand = new Command("Exit", Command.EXIT, 0);
- m3gCanvas = new M3GCanvas();
- m3gCanvas.addCommand(ExitCommand);
- m3gCanvas.setCommandListener(this);
- }
- public void startApp() {
- d.setCurrent(m3gCanvas);
- }
- public void pauseApp() {
- }
- public void destroyApp(boolean unconditional) {
- }
- public void commandAction(Command c, Displayable d){
- notifyDestroyed();
- }
- }