Demo Program for changing line thickness

Here is a programming example to show you how to use the setStroke method of the Graphics2D class to change the thickness of lines drawn in Java: