Java JEditorPane enforceJEditorPaneFont(JEditorPane jEditorPane, Font font)

Here you can find the source of enforceJEditorPaneFont(JEditorPane jEditorPane, Font font)

Description

Enforces JEditorPane font.

License

Open Source License

Declaration

public static void enforceJEditorPaneFont(JEditorPane jEditorPane, Font font) 

Method Source Code

//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);
    }
}

Related

  1. addEditorPaneToOther(JEditorPane[] old, JEditorPane add)
  2. addHyperLinkListener(JEditorPane editorPane)
  3. decorateStyleSheet(JEditorPane editor)
  4. displayEditorPaneWithNoBorderAndTranslucent(JEditorPane editorPane)
  5. emptyDoc(JEditorPane pane)
  6. formatEditorPaneAsLabel(JEditorPane editor)
  7. getEditor(JEditorPane editor, String html, int width, Color transparentColor, Font font)
  8. getImage(JEditorPane editor, Color transparentColor)
  9. initHtmlComponent(JEditorPane editorPane)