void (Graphics g) { Graphics2D g2d = (Graphics2D)g; Color oldColor = g2d.getColor(); Composite old = g2d.getComposite(); g2d.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 0.2f)); Rectangle r = getBounds(); RectanglePainter.paint(g2d, 0, 0, r.width, r.height, 0, myColor, null); ((Graphics2D)g).setPaint(myColor.darker()); for (int i = 0; i < myInsets.left; i++) { LinePainter2D.paint(g2d, i, myInsets.top, i, r.height - myInsets.bottom - 1); } for (int i = 0; i < myInsets.right; i++) { LinePainter2D.paint(g2d, r.width - i - 1, myInsets.top, r.width - i - 1, r.height - myInsets.bottom - 1); } for (int i = 0; i < myInsets.top; i++) { LinePainter2D.paint(g2d, 0, i, r.width, i); } for (int i = 0; i < myInsets.bottom; i++) { LinePainter2D.paint(g2d, 0, r.height - i - 1, r.width, r.height - i - 1); } g2d.setComposite(old); g2d.setColor(oldColor); }