void (@NotNull Graphics g, @NotNull Rectangle rect, @NotNull Color color) { Graphics2D g2 = (Graphics2D)g.create(); try { g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); g2.setRenderingHint(RenderingHints.KEY_STROKE_CONTROL, RenderingHints.VALUE_STROKE_NORMALIZE); g2.setColor(color); Rectangle innerRect = new Rectangle(rect); JBInsets.removeFrom(innerRect, JBUI.insets(1)); Path2D border = new Path2D.Float(Path2D.WIND_EVEN_ODD); border.append(rect, false); border.append(innerRect, false); g2.fill(border); } finally { g2.dispose(); } }