irectangle.java

来自「this a java painter, a very simple paint」· Java 代码 · 共 37 行

JAVA
37
字号
import java.awt.*;
import java.awt.event.*;
import java.util.Vector;

/**
* @author aassd
*
* To change this generated comment edit the template variable "typecomment":
* Window>Preferences>Java>Templates.
* To enable and disable the creation of type comments go to
* Window>Preferences>Java>Code Generation.
*/
public class IRectangle implements Shape {
private int x;
private int y;
private int width;
private int height;
private Color color;

public IRectangle(int x, int y, int width, int height, Color color) {
this.x = x;
this.y = y;
this.width = width;
this.height = height;
this.color = color;
}


public void draw(Graphics g) {
g.setColor(color);
g.drawRect(x, y, width, height);
}


}

⌨️ 快捷键说明

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