void (Graphics g) { Graphics2D g2d = (Graphics2D)g; Stroke oldStroke = g2d.getStroke(); g2d.setStroke(STROKE); g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); Dimension size = getSize(); g.drawRoundRect(0, 0, size.width - 1, size.height - 1, myRadius, myRadius); g2d.setStroke(oldStroke); }