Помимо изменений, предложенных в других ответах (setEditable, setContentType, setOpaque или setBackground, возможно, setEnabled + setDisabledTextColor (Color.black), может быть, setBorder (null) и / или setMargin (новые вставки (0,0,0) , 0))
Чтобы шрифт JTextPane выглядел как JLabel, см. Предложение из этого сообщения в блоге :
"К сожалению, простой вызов set font на JEditorPane не будет иметь никакого эффекта, так как шрифт по умолчанию извлекается из таблицы стилей, а не из JComponent. Однако есть обходной путь по умолчанию для ошибочного шрифта. Лучший способ изменить шрифт по умолчанию в HTML-рендеринге JEditorPane, это изменить таблицу стилей следующим образом: "
// create a JEditorPane that renders HTML and defaults to the system font.
JEditorPane editorPane =
new JEditorPane(new HTMLEditorKit().getContentType(),text);
// set the text of the JEditorPane to the given text.
editorPane.setText(text);
// add a CSS rule to force body tags to use the default label font
// instead of the value in javax.swing.text.html.default.csss
Font font = UIManager.getFont("Label.font");
String bodyRule = "body { font-family: " + font.getFamily() + "; " +
"font-size: " + font.getSize() + "pt; }";
((HTMLDocument)editorPane.getDocument()).getStyleSheet().addRule(bodyRule);