📄 splash.java
字号:
package org.javagarden.j2me.fivelink.client;
import java.io.IOException;
import javax.microedition.lcdui.Canvas;
import javax.microedition.lcdui.Graphics;
import javax.microedition.lcdui.Image;
import javax.microedition.lcdui.Font;
/**
* 启动画面。
* @author Turbo Chen
* @created 2005-4-6
*/
public class Splash
extends Canvas
{
private static Image COVER = null;
private static String copyright = "Copyright(c)";
private static String vendor = "www.JavaGarden.org";
public Splash()
{
try
{
COVER = Image.createImage("/org/javagarden/j2me/fivelink/client/c.gif");
}catch (IOException e)
{
}
}
protected void paint(Graphics g)
{
int w = this.getWidth();
int h = this.getHeight();
int lgw = COVER.getWidth();
int lgh = COVER.getHeight();
g.drawImage(COVER, (w-lgw)/2,0,0);
Font font = Font.getFont(Font.FACE_MONOSPACE,Font.STYLE_PLAIN, Font.SIZE_SMALL);
g.setFont(font);
h = font.getHeight()*2;
int w1 = font.stringWidth(copyright);
int w2 = font.stringWidth(vendor);
g.drawString(copyright, 5, this.getHeight()-h-5,0);
g.drawString(vendor, 5, this.getHeight()-h/2-5,0);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -