@Override
    protected void doPaint(Graphics2D g, JComponent c,
            int width, int height, Object[] extendedCacheKeys) {
        if (!c.isOpaque()) {
            return;
        }

        JTextComponent tc = (JTextComponent) c;
        if (tc.isEnabled() && !tc.isEditable() && tc.getBackground().equals(UIManager.getColor(
                ReflectionUtils.invoke(GET_PROPERTY_PREFIX, tc.getUI()) + ".background"))) {
            // If the text component is not editable, and the background is not
            // explicitly set, paint the background with inactiveBackground.
            // In Nimbus L&F, getBackground() always returns the a fake derived
            // color, we can check that color to determine whether the background
            // has been changed by the developer or not. This check is imperfect
            // but should have covered most cases.
            g.setPaint(inactiveBackground);
            if (tc.getParent() instanceof JViewport) {
                rec.setRect(decodeX(0.0F), decodeY(0.0F),
                        decodeX(3.0F) - decodeX(0.0F),
                        decodeY(3.0F) - decodeY(0.0F));
            } else {
                rec.setRect(decodeX(0.4F), decodeY(0.4F),
                        decodeX(2.6F) - decodeX(0.4F),
                        decodeY(2.6F) - decodeY(0.4F));
            }
            g.fill(rec);
        } else {
            ReflectionUtils.invoke(DO_PAINT, defaultPainter,
                    g, c, width, height, extendedCacheKeys);
        }
    }