?? infocanvas.java
字號(hào):
/*
* Author: Huang ye(www.hyweb.net)
* 代碼開源, 引用請注明出處
*
* 創(chuàng)建日期 2005-3-10
*
* TODO 要更改此生成的文件的模板,請轉(zhuǎn)至
* 窗口 - 首選項(xiàng) - Java - 代碼樣式 - 代碼模板
*/
package net.hyweb;
import javax.microedition.lcdui.Canvas;
import javax.microedition.lcdui.Font;
import javax.microedition.lcdui.Graphics;
/**
* @author user
*
* TODO 要更改此生成的類型注釋的模板,請轉(zhuǎn)至
* 窗口 - 首選項(xiàng) - Java - 代碼樣式 - 代碼模板
*/
public class InfoCanvas extends Canvas {
private StringBuffer info;
public InfoCanvas(StringBuffer info){
this.info = info;
}
protected void paint(Graphics graphics) {
graphics.setColor(255, 255, 255);
graphics.fillRect(0, 0, getWidth(), getHeight());
graphics.setColor(000000);
graphics.fillRect(0, 0,SubCanvas.mainWidth, SubCanvas.mainHeight);
graphics.setColor(255, 0, 0);
graphics.setFont(Font.getFont(Font.FACE_PROPORTIONAL, Font.STYLE_BOLD, Font.SIZE_LARGE));
graphics.drawString(info.toString(), SubCanvas.mainWidth / 2 - info.toString().length() / 2,
SubCanvas.mainHeight / 4, Graphics.BASELINE | Graphics.HCENTER);
}
}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -