java Me中的按键和触屏实例
package com.canvas.image;
import java.io.IOException;
import javax.microedition.lcdui.Canvas;
import javax.microedition.lcdui.Command;
import javax.microedition.lcdui.CommandListener;
import javax.microedition.lcdui.Display;
import javax.microedition.lcdui.Displayable;
import javax.microedition.lcdui.Graphics;
import javax.microedition.lcdui.Image;
import javax.microedition.midlet.MIDlet;
import javax.microedition.midlet.MIDletStateChangeException;
public class Plane extends MIDlet
{
private Display display=null;
private PlaneCanvas plane=null;
public Plane()
{
display=Display.getDisplay(this);
plane=new PlaneCanvas(this);
}
protected void destroyApp(boolean arg0) throws MIDletStateChangeException
{
}
protected void pauseApp()
{
}
protected void startApp() throws MIDletStateChangeException
{
display.setCurrent(plane);
}
public void close()
{
try
{
destroyApp(true);
}
catch(MIDletStateChangeException e)
{
e.printStackTrace();
}
相关新闻>>
- 发表评论
-
- 最新评论 更多>>