import java.awt.geom.*; static void fillRoundedBox(Graphics2D g, int x, int y, int w, int h, int roundness, Color color) { g.setColor(color); g.fill(new RoundRectangle2D.Double(x, y, w, h, roundness, roundness)); }