Class Console

java.lang.Object
com.lowagie.rups.view.Console
All Implemented Interfaces:
Observer

public class Console extends Object implements Observer
A Class that redirects everything written to System.out and System.err to a JTextPane.
  • Field Details

  • Constructor Details

  • Method Details

    • getInstance

      public static Console getInstance()
      Console is a Singleton class: you can only get one Console.
      Returns:
      the Console
    • println

      public static void println(String s)
      Allows you to print something to the custom PrintStream.
      Parameters:
      s - the message you want to send to the Console
    • update

      public void update(Observable observable, Object obj)
      Specified by:
      update in interface Observer
      See Also:
    • getPrintStream

      public PrintStream getPrintStream()
      Get the custom PrintStream of the console.
      Returns:
      the PrintStream
    • getTextArea

      public JTextPane getTextArea()
      Get the JTextArea to which everything is written.
      Returns:
      the JTextArea