Code example for HTMLDocument

Methods: getStyleSheet

0
    editorPane = new JEditorPane();
    editorPane.setEditable(false);
    editorPane.setContentType("text/html");//NON-NLS
    editorPane.setText(getSystemInformationAsHTML());
    final HTMLDocument htmlDocument = (HTMLDocument) editorPane.getDocument();
    htmlDocument.getStyleSheet().addRule("body { font-family:sans-serif; }");//NON-NLS
    editorPane.setCaretPosition(0);
 
    super.init(); 
    getConfirmAction().putValue(Action.NAME, UtilMessages.getInstance().getString("SystemInformationDialog.Close"));
  } 
 
  protected void performInitialResize() 
  { 
    pack(); 
    GUIUtils.ensureMinimumDialogSize(this, 400, 300);
    GUIUtils.ensureMaximumDialogSize(this, 800, 600);
 
    LibSwingUtil.centerDialogInParent(this);
  }