The center is at x = width/2
and y = height/2
.
Remember that the upper-left corner is at (0, 0)
Consider the method that draws the star:
drawStar( Graphics gr, int x, int y, int size )
Each line (of the six) starts at the center,
and ends at a point on the circle of radius size
.
The X distance from the center of a point on a circle
is size*cos( theta )
.
The Y distance from the center of a point on a circle
is size*sin( theta )
.
All you need to do is find the six values for theta and the six endpoints are yours.
How many radians are there in a circle?