void (Component c, Graphics g, int x, int y, int width, int height) { if (!(c instanceof AbstractButton b) || UIUtil.isHelpButton(c)) return; Graphics2D g2 = (Graphics2D)g.create(); Rectangle outerRect = new Rectangle(x, y, width, height); try { JBInsets.removeFrom(outerRect, b.getInsets()); g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); g2.setRenderingHint(RenderingHints.KEY_STROKE_CONTROL, RenderingHints.VALUE_STROKE_NORMALIZE); Path2D border = new Path2D.Float(Path2D.WIND_EVEN_ODD); border.append(outerRect, false); Rectangle innerRect = new Rectangle(outerRect); JBInsets.removeFrom(innerRect, JBUI.insets(getBorderWidth(b))); border.append(innerRect, false); g2.setColor(getBorderColor(b)); if (!c.isEnabled()) { g2.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, DISABLED_ALPHA_LEVEL)); } g2.fill(border); } finally { g2.dispose(); } }