private static String wrap(String text) {

		StringBuilder buffy = new StringBuilder();

		// Wrap any poorly formatted text that gets displayed in the label; 80-100 chars is
		// a reasonable line length based on historical print margins.
		// Update: increased the limit to handle long messages containing stack trace elements,
		//         which look odd when wrapped
		int limit = 120;
		List<String> lines = HtmlLineSplitter.split(text, limit, true);
		String newline = "\n";
		for (String line : lines) {

			if (buffy.length() != 0) {
				buffy.append(newline);
			}

			if (StringUtils.isBlank(line)) {
				// this will trim all leading blank lines, but preserve internal blank lines,
				// which clients may be providing for visual line separation
				continue;
			}

			String wrapped = line;
			if (line.length() > limit) {
				// this method will trim leading spaces; only call if the line is too long
				wrapped = WordUtils.wrap(line, limit, null, true);
			}

			buffy.append(wrapped);
		}
		return buffy.toString();
	}
Error dialog used to append exceptions.

<p>While this dialog is showing all new exceptions will be added to the dialog.  When
this dialog is closed, this reference will be cleared.

<p>Note: all use of this variable <b>must be on the Swing thread</b> to avoid thread
visibility issues.
Ghidra/Framework/Docking/src/main/java/docking/DockingErrorDisplay.java