Graphics2D arg;
float thick=3.0f;
arg1.setStroke(new BasicStroke(thick, BasicStroke.CAP_SQUARE, BasicStroke.JOIN_ROUND));
arg1.drawLine(first.x, first.y, next.x, next.y);
arg1.setColor(Color.red);
本文介绍如何使用Graphics2D API来绘制一条具有特定样式的线条。通过设置线条的粗细为3.0f,并采用方形的笔帽样式及圆角连接的方式,实现线条的自定义显示效果。
Graphics2D arg;
float thick=3.0f;
arg1.setStroke(new BasicStroke(thick, BasicStroke.CAP_SQUARE, BasicStroke.JOIN_ROUND));
arg1.drawLine(first.x, first.y, next.x, next.y);
arg1.setColor(Color.red);
1379

被折叠的 条评论
为什么被折叠?