The Stroke interface for borders and lines
With Graphics2D, the current graphics context includes the current “stroke”: g2d.setStroke ( s ); where s is anything that implements the interface Stroke.
Class BasicStroke provides a variety of constructors to specify the width of the line, how the line ends (the end caps), how lines join together (join lines), and the dash attributes of the line.
- new BasicStroke ( width, endcaps, joins, mitrelimit, dasharray, dashphase)where dasharray gives the lengths of a sequence of dashes and dashphase gives which dash to start with.