@Override
  public void paintBorder(Component c, Graphics g, int x, int y, int width, int height) {
    if (isComboBoxEditor(c)) {
      g.setColor(c.getBackground());
      g.fillRect(x, y, width, height);
      return;
    }

    EditorTextField editorTextField = ComponentUtil.getParentOfType((Class<? extends EditorTextField>)EditorTextField.class, c);
    if (editorTextField == null) return;

    Graphics2D g2 = (Graphics2D)g.create();
    try {
      Rectangle r = new Rectangle(x, y, width, height);
      boolean isCellRenderer = DarculaUIUtil.isTableCellEditor(c);

      if (ComponentUtil.getParentOfType((Class<? extends Wrapper>)Wrapper.class, c) != null && TextFieldWithPopupHandlerUI
        .isSearchFieldWithHistoryPopup(c)) {
        JBInsets.removeFrom(r, JBInsets.create(2, 0));
      }

      g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
      g2.setRenderingHint(RenderingHints.KEY_STROKE_CONTROL, RenderingHints.VALUE_STROKE_NORMALIZE);

      // Fill background area of border
      if (isBorderOpaque() || c.getParent() != null) {
        g2.setColor(c.getParent().getBackground());

        Path2D borderArea = new Path2D.Float(Path2D.WIND_EVEN_ODD);
        borderArea.append(r, false);

        Rectangle innerRect = new Rectangle(r);
        JBInsets.removeFrom(innerRect, JBUI.insets(isCellRenderer ? 1 : 2));
        borderArea.append(innerRect, false);
        g2.fill(borderArea);
      }

      // draw border itself
      boolean hasFocus = editorTextField.getFocusTarget().hasFocus();
      int bw = 1;

      DarculaUIUtil.Outline op = DarculaUIUtil.getOutline(editorTextField);
      if (editorTextField.isEnabled() && op != null) {
        op.setGraphicsColor(g2, c.hasFocus());
        bw = isCellRenderer ? 1 : 2;
      }
      else {
        if (hasFocus) {
          g2.setColor(UIManager.getColor("TextField.focusedBorderColor"));
        }
        else if (editorTextField.isEnabled() &&
                 editorTextField.getClientProperty(HOVER_PROPERTY) == Boolean.TRUE) {
          g2.setColor(UIManager.getColor("TextField.hoverBorderColor"));
        }
        else {
          g2.setColor(UIManager.getColor("TextField.borderColor"));
        }

        if (!isCellRenderer) {
          JBInsets.removeFrom(r, JBUI.insets(1));
        }
      }

      if (!editorTextField.isEnabled()) {
        g2.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 0.47f));
      }

      Path2D border = new Path2D.Float(Path2D.WIND_EVEN_ODD);
      border.append(r, false);

      Rectangle innerRect = new Rectangle(r);
      JBInsets.removeFrom(innerRect, JBUI.insets(bw));
      border.append(innerRect, false);

      g2.fill(border);
    }
    finally {
      g2.dispose();
    }
  }
@Override
  public void paintBorder(Component c, Graphics g, int x, int y, int width, int height)