@Override
	public JComponent getHoverComponent(Program program, ProgramLocation programLocation,
			FieldLocation fieldLocation, Field field) {

		initializeLazily();
		if (!enabled || programLocation == null || panel == null) {
			return null;
		}

		if (programLocation instanceof MnemonicFieldLocation) {
			CodeUnit cu = program.getListing().getCodeUnitAt(programLocation.getAddress());
			if (!(cu instanceof Instruction)) {
				return null; // defer to mnemonic hover for Data
			}
		}

		Address refAddr = programLocation.getRefAddress();
		if (refAddr != null && refAddr.isExternalAddress()) {
			return createExternalToolTipComponent(program, refAddr);
		}

		previewLocation =
			getPreviewLocation(program, programLocation, programLocation.getRefAddress());
		if (previewLocation == null) {
			return null;
		}

		panel.setProgram(program); // the program must be set in order for the goto to work
		boolean validLocation = panel.goTo(previewLocation);
		if (validLocation) {
			Rectangle bounds = panel.getBounds();
			bounds.x = WINDOW_OFFSET;
			bounds.y = WINDOW_OFFSET;
			panel.setBounds(bounds);
			return panel;
		}
		panel.setProgram(null);

		// At this point we have a program location, but we could not go there.  This can happen
		// if the location is not in memory.
		return createOutOfMemoryToolTipComponent(previewLocation);
	}
initializeLazily() should get called to try to get the CodeFormatService and create the panel
the first time we want to use the panel.
Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/hover/AbstractReferenceHover.java