Here you can find the source of enforceJEditorPaneFont(JEditorPane jEditorPane, Font font)
public static void enforceJEditorPaneFont(JEditorPane jEditorPane, Font font)
//package com.java2s; import javax.swing.JEditorPane; import java.awt.Font; public class Main { /**//from w w w . ja v a 2 s . co m * Enforces JEditorPane font. * Once the content type of a JEditorPane is set to text/html the font on the Pane starts to be managed by Swing. * This method forces using provided font. */ public static void enforceJEditorPaneFont(JEditorPane jEditorPane, Font font) { jEditorPane.putClientProperty(JEditorPane.HONOR_DISPLAY_PROPERTIES, Boolean.TRUE); jEditorPane.setFont(font); } }