doc.setBufferSize(viewSize);
if (viewSize != -2) doc.setBufferSize(viewSize);
  private void setViewSize_actionPerformed() {    ConsoleStyledDocument doc =       (ConsoleStyledDocument)consoleTextPane.getStyledDocument();    int viewSize = CSMARTConsole.displayViewSizeDialog(doc.getBufferSize());    doc.setBufferSize(viewSize);  }