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

📄 exec.java

📁 在NETBEANS环境下
💻 JAVA
字号:
import javax.microedition.lcdui.Canvas;
import javax.microedition.lcdui.Display;
import javax.microedition.lcdui.Graphics;
import javax.microedition.midlet.MIDlet;

public class Exec extends MIDlet {
	private Display display;

	public Exec() {
		display = Display.getDisplay(this);
	}

	public void startApp() {

		display.setCurrent(new DrawPanel());
	}

	public void pauseApp() {
	}

	public void destroyApp(boolean unconditional) {
	}
}

class DrawPanel extends Canvas {
	public void paint(Graphics g) {
		int width = getWidth() * 2 / 3;
		int left = getWidth() * 1 / 6;
		int height = getHeight() * 2 / 3;
		int top = getHeight() * 1 / 6;

		g.setColor(0, 0, 0);
		g.fillArc(left, top, width, height, 90, 180);

		g.setColor(255, 255, 0);
		g.fillArc(left, top, width, height, 270, 180);

		g.setColor(0, 0, 0);
		g.fillArc(left * 2, top * 3, width / 2, height / 2, 270, 180);

		g.setColor(255, 255, 0);
		g.fillArc(left * 2, top, width / 2, height / 2, 0, 360);

		g.setColor(255, 255, 0);
		g.fillArc(left * 2 + left * 3 / 4, top * 3 + top * 3 / 4, width / 8,
				height / 8, 0, 360);

		g.setColor(255, 0, 0);
		g.fillArc(left * 2 + left * 3 / 4, top + top * 3 / 4, width / 8,
				height / 8, 0, 360);
	}
}

⌨️ 快捷键说明

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