@Override protected void paintSafely(Graphics g) { super.paintSafely(g); JTextComponent comp = getComponent(); if (hint != null && comp.getText().length() == 0 && (!(hideOnFocus && comp.hasFocus()))) { if (color != null) { g.setColor(color); } else { g.setColor(comp.getForeground().brighter().brighter().brighter()); } int padding = (comp.getHeight() - comp.getFont().getSize()) / 2; g.drawString(hint, 3, comp.getHeight() - padding - 1); } }
protected void paintSafely(final Graphics g) { paintBackgroundSafely(g); super.paintSafely(g); }