Skip to main content

low level UI

Please note these java.net forums are being decommissioned and use the new and improved forums at https://community.oracle.com/community/java.
1 reply [Last post]
kuxz2008
Offline
Joined: 2011-01-16

I would like to know how do i thicken the line of the arc drawn using drawArc?

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
sfitzjava
Offline
Joined: 2003-06-15

This is done the same way you make thicker lines using drawLine, rinse and repeat. :)

// this makes a multi-pixel thick vertical line as x is being moved
// to make it horizontal add i to the y values instead of the x values.
for(int i=0; i< thickness;i++)
graphics.drawLine(x1+i, y1, x2+i, y2);

// here I am adding it to the x and width values
// however you might try adding to x and subtracting from W
// You may also want to do the same on the y & h values for different effects
for(int i=0; i< thickness;i++)
graphics.drawArc(x+i, y, w+i, h);