void (Graphics g) { super.paintChildren(g); Component title = myLayout.getTitle(); if (title != null && myLayoutData.showActions != null && myLayoutData.showActions.compute()) { int width = myLayoutData.configuration.allActionsOffset; int x = getWidth() - width - JBUIScale.scale(5); int y = myLayoutData.configuration.topSpaceHeight; int height = title instanceof JEditorPane ? getFirstLineHeight((JEditorPane)title) : title.getHeight(); g.setColor(myLayoutData.fillColor); g.fillRect(x, y, width, height); width = myLayoutData.configuration.beforeGearSpace; x -= width; ((Graphics2D)g) .setPaint(new GradientPaint(x, y, ColorUtil.withAlpha(myLayoutData.fillColor, 0.2), x + width, y, myLayoutData.fillColor)); g.fillRect(x, y, width, height); } }