Here you can find the source of drawStatesInCircle(Graphics2D g2d, int x, int y, int width, int height, Color... stateColors)
public static void drawStatesInCircle(Graphics2D g2d, int x, int y, int width, int height, Color... stateColors)
//package com.java2s; import java.awt.*; public class Main { public static void drawStatesInCircle(Graphics2D g2d, int x, int y, int width, int height, Color... stateColors) { int states = stateColors.length; if (states > 0) { int startAngle = 0, arcAngle = 360 / states; for (Color stateColor : stateColors) { g2d.setColor(stateColor); g2d.fillArc(x, y, width, height, startAngle, arcAngle); startAngle = startAngle + arcAngle; }//from w ww.ja va 2s . com } g2d.setColor(Color.BLACK); g2d.drawOval(x, y, width, height); } }