void (Graphics g) { JTextComponent c = getComponent(); Graphics2D g2 = (Graphics2D)g.create(); try { Container parent = c.getParent(); if (c.isOpaque() && parent != null) { g2.setColor(parent.getBackground()); g2.fillRect(0, 0, c.getWidth(), c.getHeight()); } if (c.getBorder() instanceof WinIntelliJTextBorder) { WinIntelliJTextFieldUI.paintTextFieldBackground(c, g2); } } finally { g2.dispose(); } }