Name

javax.microedition.lcdui.Canvas

Synopsis

Canvas is an abstract class, which is the base class for writing MIDlets that need to implement low-level events and to issue graphics calls for drawing on the display. Since this class will be used heavily for game applications, it provides ways to handle game actions, key events, and pointer events.

public abstract classCanvas extends Displayable {
   // public class fields
   public static final int DOWN = 6;
   public static final int FIRE = 8;
   public static final int GAME_A = 9;
   public static final int GAME_B = 10;
   public static final int GAME_C = 11;
   public static final int GAME_D = 12;
   public static final int KEY_NUM0 = 48;
   public static final int KEY_NUM1 = 49;
   public static final int KEY_NUM2 = 50;
   public static final int KEY_NUM3 = 51;
   public static final int KEY_NUM4 = 52;
   public static final int KEY_NUM5 = 53;
   public static final int KEY_NUM6 = 54;
   public static final int KEY_NUM7 = 55;
   public static final int KEY_NUM8 = 56;
   public static final int KEY_NUM9 = 57;
   public static final int KEY_POUND = 35;
   public static final int KEY_STAR = 42;
   public static final int LEFT = 2;
   public static final int RIGHT = 5;
   public static final int UP = 1;
   // protected constructors
   protected Canvas(  );
   // protected instance methods
   protected void hideNotify(  );
   protected void keyPressed(int keyCode);
   protected void keyReleased(int keyCode);
   protected void keyRepeated(int keyCode);
   protected abstract void paint(Graphics g);
   protected void pointerDragged ...

Get Wireless Java now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.