java设置线条粗线及颜色

  • Post author:
  • Post category:java


线条粗细:
Graphics2D g2=(Graphics2D)g;
Stroke stroke=new BasicStroke(3.0f);//设置线宽为3.0
g2.setStroke(stroke);
颜色:
g2.setPaint(Color.green);
g2.setColor(new Color(255,0,0));



版权声明:本文为Hectorhua原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。