Custom creation method for JEditorPane . - Java Swing

Java examples for Swing:JEditorPane

Description

Custom creation method for JEditorPane .

Demo Code


//package com.java2s;

import javax.swing.JEditorPane;

public class Main {
    /**/*from   w w w .j  av  a 2  s  . c om*/
     * Custom creation method for {@link JEditorPane}.
     */
    public static JEditorPane createReadOnlyHtmlEditorPane() {
        final JEditorPane jEditorPane = new JEditorPane();
        jEditorPane.setContentType("text/html");
        jEditorPane.setEditable(false);
        return jEditorPane;
    }
}

Related Tutorials