I just wanted to know how to draw a thick line and also can anyone tell how drawArc works , in know how to make it work (x,y,width,height,startAngle,Arcangle) but i cant figure it out. Line just arc in ways i dont really understand. Thanks.
Run this code below. See the comments for an explanation. This should help understand what you need to use.
class TestPanel extends JPanel
public void paint(Graphics g)
//cast to Graphics2D
Graphics2D g2D = (Graphics2D)(g);
int lineWidth = 5;
g2D.setStroke( new BasicStroke(lineWidth));
g2D.drawLine(0,0, 100, 100);
//draw an arc from 45 degrees to (45+90) degrees. 90 determines how wide the arc is
g2D.drawArc(0,0, 100, 100, 45, 90);
public static void main(String a)
JFrame j = new JFrame();
j.getContentPane().add( new TestPanel());