我正在尝试用Java编写一个简单的绘图applet,但是我遇到了BasicStroke的问题.最初,我的计划是试图以某种方式画一条宽度的线,但API显然不支持这一点.
我尝试使用BasicStroke,但结果只是一个模糊的混乱.我该如何修复这个模糊问题?
private void mousedrag_hook(Point point)
{
if(start == null)
start = point;
end = point;
Graphics2D g2d = (Graphics2D)applInstance.buffer_g;
g2d.setStroke(new BasicStroke(7));
//g2d.fillOval(point.x - 5, point.y - 5, 10, 10);
g2d.drawLine(start.x, start.y, end.x, end.y);
applInstance.repaint();
start = end;
}