⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 splash.java~23~

📁 j2me源代码
💻 JAVA~23~
字号:
package wzq;

import javax.microedition.lcdui.*;

/**
 * <p>Title: </p>
 *
 * <p>Description: </p>
 *
 * <p>Copyright: Copyright (c) 2005</p>
 *
 * <p>Company: </p>
 *
 * @author not attributable
 * @version 1.0
 */
public class Splash extends Canvas {
    private StringBuffer strInf;
    private Image img;
    private int nWidth = getWidth();
    private int nHeight = getHeight();

    public Splash(StringBuffer Info) {
        this.strInf = Info;
    }

    public Splash(StringBuffer Info, Image img) {
        this.strInf = Info;
        this.img = img;
    }

    /**
     * paint
     *
     * @param graphics Graphics
     * @todo Implement this javax.microedition.lcdui.Canvas method
     */
    protected void paint(Graphics graphics) {
        graphics.setColor(0, 0, 0);
        graphics.fillRect(0, 0, nWidth, nHeight);
        if (img != null) {
            graphics.drawImage(img, nWidth / 2, 0,
                               Graphics.HCENTER | Graphics.VCENTER);
        }
        graphics.setColor(255, 0, 0);
        graphics.setFont(Font.getFont(Font.FACE_PROPORTIONAL, Font.STYLE_BOLD,
                                      Font.SIZE_LARGE));
        graphics.drawString(strInf.toString(),
                            nWidth / 2 - strInf.toString().length() / 2,
                            nHeight / 4,
                            Graphics.BASELINE | Graphics.HCENTER);
    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -