📄 welcome.java
字号:
package dynamicP;
import javax.microedition.lcdui.Canvas;
import javax.microedition.lcdui.Graphics;
import javax.microedition.lcdui.Image;
public class Welcome extends Canvas {
private int width;
private int height;
private Image imgU;
public Welcome(String bigPic, String smallPic) {
width = this.getWidth();
height = this.getHeight();
try {
Image img;
if(width > 150) {
img = Image.createImage(bigPic);
} else {
img = Image.createImage(smallPic);
}
imgU = Image.createImage(width, height);
Graphics g = imgU.getGraphics();
g.drawImage(img, width / 2, height / 2, Graphics.HCENTER | Graphics.VCENTER);
} catch(Exception e) {
System.out.println(10000);
}
}
protected void paint(Graphics g) {
g.drawImage(imgU, 0, 0, Graphics.LEFT | Graphics.TOP);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -