Example usage for javax.swing JEditorPane setMaximumSize

List of usage examples for javax.swing JEditorPane setMaximumSize

Introduction

In this page you can find the example usage for javax.swing JEditorPane setMaximumSize.

Prototype

@BeanProperty(description = "The maximum size of the component.")
public void setMaximumSize(Dimension maximumSize) 

Source Link

Document

Sets the maximum size of this component to a constant value.

Usage

From source file:Main.java

public void createJEditorPane(Container bg, Dimension size) {
    JEditorPane pane = new JEditorPane();
    pane.setEditable(false);//w  ww.  j a  v  a  2s. c o m
    HTMLEditorKit editorKit = new HTMLEditorKit();
    pane.setEditorKit(editorKit);
    pane.setSize(size);
    pane.setMinimumSize(size);
    pane.setMaximumSize(size);
    pane.setOpaque(true);
    pane.setText(
            "<b><font face=\"Arial\" size=\"50\" align=\"center\" > Unfortunately when I display this string it is too long and doesn't wrap to new line!</font></b>");
    bg.add(pane, BorderLayout.CENTER);
}