JComponent () { JComponent textComponent; if (BasicHTML.isHTMLString(myMessage)) { textComponent = createMessageComponent(myMessage); } else { JLabel textLabel = new JLabel(myMessage); textLabel.setUI(new MultiLineLabelUI()); textComponent = textLabel; } textComponent.setBorder(BorderFactory.createEmptyBorder(0, 0, 5, 20)); return textComponent; }