@SuppressWarnings({"UndesirableClassUsage", "HardCodedStringLiteral"})
  private static JScrollPane prepareMessage(String message) {
    var textPane = new JTextPane();
    textPane.setEditable(false);
    textPane.setText(message.replaceAll("\t", "    "));
    textPane.setBackground(UIManager.getColor("Panel.background"));
    textPane.setCaretPosition(0);

    var scrollPane = new JScrollPane(textPane, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED);
    scrollPane.setBorder(null);

    var maxHeight = Toolkit.getDefaultToolkit().getScreenSize().height / 2;
    var maxWidth = Toolkit.getDefaultToolkit().getScreenSize().width / 2;
    var paneSize = scrollPane.getPreferredSize();
    if (paneSize.height > maxHeight || paneSize.width > maxWidth) {
      scrollPane.setPreferredSize(new Dimension(Math.min(maxWidth, paneSize.width), Math.min(maxHeight, paneSize.height)));
    }
    return scrollPane;
  }
@SuppressWarnings({"UndesirableClassUsage", "HardCodedStringLiteral"})
  private static JScrollPane prepareMessage(String message)