private JLabel createMessageLabel(String message) {

		if (HTMLUtilities.isHTML(message)) {
			// Client HTML; keep as-is
			return new MaxWidthHtmlLabel(message);
		}

		if (message.indexOf('\n') != 0) {
			// JLabels do not handle newlines, so we must update the text to reflect the client's
			// desired newlines.  Escape any content that may have angle brackets so it does not get
			// removed when we convert the text to HTML.  Convert newlines to break tags so the
			// label will correctly line wrap as intended by the client.
			String html = HTMLUtilities.toLiteralHTML(message, 0);
			return new MaxWidthHtmlLabel(html);
		}

		return new GLabel(message);
	}
tracks 'details panel' open state across invocations
Ghidra/Framework/Docking/src/main/java/docking/ErrLogDialog.java