List of usage examples for java.awt BasicStroke createStrokedShape
public Shape createStrokedShape(Shape s)
From source file:Main.java
public void paint(Graphics g) { Graphics2D g2 = (Graphics2D) g; BasicStroke stroke = new BasicStroke(10, BasicStroke.CAP_BUTT, BasicStroke.JOIN_BEVEL, 0.1F); g2.setPaint(Color.black);/*w ww. jav a2s . co m*/ g2.draw(stroke.createStrokedShape(new Rectangle2D.Float(10, 10, 20, 20))); }