Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

import javax.swing.JEditorPane;

import java.awt.Font;

public class Main {
    /**
     * 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);
    }
}