示例#1
0
  @edu.umd.cs.findbugs.annotations.SuppressFBWarnings(
      value = "DM_DEFAULT_ENCODING",
      justification = "Can only be called from the same instance so default encoding OK")
  private SystemConsole() {
    // Record current System.out and System.err
    // so that we can still send to them
    originalOut = System.out;
    originalErr = System.err;

    // Create the console text area
    console = new JTextArea();

    // Setup the console text area
    console.setRows(20);
    console.setColumns(120);
    console.setFont(new Font(fontFamily, fontStyle, fontSize));
    console.setEditable(false);
    setScheme(scheme);
    setWrapStyle(wrapStyle);

    this.outputStream = new PrintStream(outStream(STD_OUT), true);
    this.errorStream = new PrintStream(outStream(STD_ERR), true);

    // Then redirect to it
    redirectSystemStreams();
  }