📄 e579. changing the thickness of the stroking pen.txt
字号:
dashPhase is the offset to start the dashing pattern.
// See e575 The Quintessential Drawing Program
public void paint(Graphics g) {
Graphics2D g2d = (Graphics2D)g;
float strokeThickness = 5.0f;
// A solid stroke
BasicStroke stroke = new BasicStroke(strokeThickness);
g2d.setStroke(stroke);
// Draw shapes...; see e586 Drawing Simple Shapes
// A dashed stroke
float miterLimit = 10f;
float[] dashPattern = {10f};
float dashPhase = 5f;
stroke = new BasicStroke(strokeThickness, BasicStroke.CAP_BUTT,
BasicStroke.JOIN_MITER, miterLimit, dashPattern, dashPhase);
g2d.setStroke(stroke);
// Draw shapes...; see e586 Drawing Simple Shapes
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -