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

📄 tukmidp$firstcanvas.java

📁 骑三轮车拉客的小游戏
💻 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 + -