coloredrect.java
来自「MPICH是MPI的重要研究,提供了一系列的接口函数,为并行计算的实现提供了编程」· Java 代码 · 共 24 行
JAVA
24 行
import com.sun.java.swing.Icon;import java.awt.Color;import java.awt.Graphics;import java.awt.Component;/** * This class is used to make the colored rect representing a state */public class ColoredRect implements Icon { Color color; public ColoredRect (Color c) { this.color = c; } public void paintIcon(Component c, Graphics g, int x, int y) { Color oldColor = g.getColor(); g.setColor(color); g.fill3DRect(x,y,getIconWidth(), getIconHeight(), true); g.setColor(oldColor); } public int getIconWidth() { return 25; } public int getIconHeight() { return 18; }}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?