📄 tukmidp$firstcanvas.java
字号:
import com.nokia.mid.ui.FullCanvas;
import java.io.PrintStream;
import javax.microedition.lcdui.Canvas;
import javax.microedition.lcdui.Font;
import javax.microedition.lcdui.Graphics;
import javax.microedition.lcdui.Image;
class FirstCanvas extends FullCanvas
{
int width;
int height;
Image imgLogo;
public FirstCanvas()
{
this.width = getWidth();
this.height = getHeight();
try
{
this.imgLogo = Image.createImage("/logo.png");
} catch (Exception ex) {
System.out.println("Could not load logo image");
}
}
public void paint() {
g.setColor(0, 0, 0);
g.fillRect(0, 0, this.width, this.height);
g.setColor(255, 255, 255);
g.setFont(Font.getFont(0, 1, 16));
g.drawImage(this.imgLogo, this.width / 2 - this.imgLogo.getWidth() / 2, this.height / 2 - this.imgLogo.getHeight() / 2, 20);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -