void (Graphics g) { final Insets i = getInsets(); final Rectangle r = getBounds(); final int width = r.width - i.left - i.right; final int height = r.height - i.top - i.bottom; //noinspection UseJBColor g.setColor(Color.WHITE); g.fillRect(i.left, i.top, width, height); g.setColor(myColor); g.fillRect(i.left, i.top, width, height); //noinspection UseJBColor g.setColor(Color.BLACK); g.drawRect(i.left, i.top, width - 1, height - 1); //noinspection UseJBColor g.setColor(Color.WHITE); g.drawRect(i.left + 1, i.top + 1, width - 3, height - 3); }