e589. stroking or filling a shape.txt
来自「这里面包含了一百多个JAVA源文件」· 文本 代码 · 共 19 行
TXT
19 行
A stroked shape is an outline of the shape. A filled shape is drawn with filled with a color. See also e575 The Quintessential Drawing Program.
public void paint(Graphics g) {
Graphics2D g2d = (Graphics2D)g;
// Set pen color for stroked shape
g2d.setColor(Color.red);
// Stroke the shape
g2d.draw(shape);
// Set fill color for filled shape
g2d.setColor(Color.blue);
// Fill the shape
g2d.fill(shape);
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?