1 doja不支持command
2 doja创建图片
4 绘制,没有居中
字体:
font = Font.getDefaultFont();
font.getHeight();
font.stringWidth(s);
联网:
和J2ME类似,只是不要忘记了
conn.connect();
按键响应:
/**
* 按键处理
*/
public void processEvent(int type, int param)
{
switch( type )
{
case Display.KEY_PRESSED_EVENT:
{
keyPressed(param);
break;
}
case Display.KEY_RELEASED_EVENT:
{
keyReleased(param);
break;
}
case Display.RESUME_VM_EVENT:
{
System.gc();
break;
}
}
}
public static final int VK_UP = 1;
public static final int VK_DOWN = 1 << 1;
public static final int VK_LEFT = 1 << 2;
public static final int VK_RIGHT = 1 << 3;
public static final int VK_SELECT = 1 << 4;
public static final int VK_0 = 1 << 5;
public static final int VK_1 = 1 << 6;
public static final int VK_2 = 1 << 7;
public static final int VK_3 = 1 << 8;
public static final int VK_4 = 1 << 9;
public static final int VK_5 = 1 << 10;
public static final int VK_6 = 1 << 12;
public static final int VK_7 = 1 << 13;
public static final int VK_8 = 1 << 14;
public static final int VK_9 = 1 << 15;
public static final int VK_STAR = 1 << 15;
public static final int VK_POUND = 1 << 16;
public static final int VK_LEFT_SOFT = 1 << 17;
public static final int VK_RIGHT_SOFT = 1 << 18;
public static final int VK_CENTER_SOFT = 1 << 19;
protected static int keyCurrent;
protected void keyPressed(int keyCode)
{
keyCurrent = getKey(keyCode);
keyProc(keyCurrent);
}
protected void keyReleased(int keyCode)
{
//keyCurrent &= ~getKey(keyCode);
}