List of usage examples for javax.swing JEditorPane setMaximumSize
@BeanProperty(description = "The maximum size of the component.") public void setMaximumSize(Dimension maximumSize)
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); }