test.java

来自「《Java2图形设计卷II:Swing》配套光盘源码」· Java 代码 · 共 20 行

JAVA
20
字号
import java.awt.*;
import javax.swing.*;

public class Test extends JApplet {
	ColorIcon 	redIcon = new ColorIcon(Color.red, 50, 50),
				blueIcon = new ColorIcon(Color.blue, 60, 60),
				yellowIcon = new ColorIcon(Color.yellow, 70, 70);

	public void paint(Graphics g) {
		redIcon.paintIcon(this, g, 0, 0);

		blueIcon.paintIcon(this, g,
							redIcon.getIconWidth() + 10, 0);

		yellowIcon.paintIcon(this, g,
							redIcon.getIconWidth() + 10 +
							blueIcon.getIconWidth() + 10, 0);
	}
}

⌨️ 快捷键说明

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