@Override
	public void paintComponent(Graphics g) {
		super.paintComponent(g);

		if (!getText().isEmpty() || hint == null) {
			return;
		}

		Graphics2D g2 = (Graphics2D) g;
		g2.setColor(Messages.HINT);
		g2.setFont(g2.getFont().deriveFont(Font.ITALIC));
		g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);

		Dimension size = getSize();
		Insets insets = getInsets();
		int x = 10; // offset
		int y = size.height - insets.bottom - 1;
		g2.drawString(hint, x, y);
	}
Overridden to paint the hint text over the field when it's empty
Ghidra/Framework/Docking/src/main/java/docking/widgets/textfield/HintTextField.java