void (Graphics g) { final Insets i = getInsets(); final Dimension d = getSize(); final int left = i.left + (d.width - i.left - i.right - WIDTH) / 2; final int top = i.top + (d.height - i.top - i.bottom - HEIGHT) / 2; g.setColor(Color.WHITE); g.fillRect(left, top, WIDTH, HEIGHT); g.setColor(Color.GRAY); g.drawLine(left + 1, i.top + HEIGHT / 2, left + WIDTH - 3, i.top + HEIGHT / 2); g.drawRect(left + 1, top + 1, WIDTH - 3, HEIGHT - 3); for (int k = 1; k < 10; k++) { g.drawLine(left + 1 + k * 31, top + 1, left + 1 + k * 31, top + HEIGHT - 3); } for (int r = 0; r < myRecentColors.size(); r++) { int row = r / 10; int col = r % 10; Color color = myRecentColors.get(r); g.setColor(color); g.fillRect(left + 2 + col * 30 + col + 1, top + 2 + row * 30 + row + 1, 28, 28); } }