Draw ring with given thickness, position, and radius. (Java2D)
问题 I need to draw a ring, with given thickness, that looks something like this: The center must be transparent, so that it doesn't cover previously drawn shapes. (or other rings) I've tried something like this: //g is a Graphics2D object g.setColor(Color.RED); g.drawOval(x,y,width,height); g.setColor(Color.WHITE); g.drawOval(x+thickness,y+thickness,width-2*thickness,height-2*thickness); which draws a satisfactory ring, but it covers other shapes; the interior is white, not transparent. How can I