JPanel descriptionPanel = new JPanel(new BorderLayout());
JEditorPane descriptionEditorPane = new JEditorPane(description.startsWith("<html>")? "text/html": "text/plain", description) {
@Override
public EditorKit getEditorKitForContentType(String type){
if("text/plain".equalsIgnoreCase(type)) {
StyledEditorKit styledEditorKit = new StyledEditorKit();
MutableAttributeSet inputAttributes = styledEditorKit.getInputAttributes();
StyleConstants.setFontFamily(inputAttributes, DESCRIPTION_FONT.getFamily());
StyleConstants.setFontSize(inputAttributes, DESCRIPTION_FONT.getSize());
return styledEditorKit;
}
return super.getEditorKitForContentType(type);