private Dimension getBestSize() {
			int width = getBestWidth();
			Dimension d = super.getPreferredSize();
			d.width = Math.min(width, d.width);
			return d;
		}
A text pane that can render links.
Ghidra/Framework/Docking/src/main/java/docking/widgets/GHyperlinkComponent.java