Class ConsoleWriter

java.lang.Object
java.io.Writer
org.patrodyne.jvnet.basicjaxb.explore.ConsoleWriter
All Implemented Interfaces:
Closeable, Flushable, Appendable, AutoCloseable

public class ConsoleWriter extends Writer
This class extends from Writer to redirect output to a JTextArea.
Author:
Rick O'Sulllivan
  • Constructor Details

    • ConsoleWriter

      public ConsoleWriter(int points)
      Construct with built-in, read-only JTextArea.
      Parameters:
      points - The font size.
  • Method Details

    • getTextArea

      public JTextArea getTextArea()
    • largerText

      public void largerText()
      Increase text font (float) size.
    • smallerText

      public void smallerText()
      Decrease text font (float) size.
    • write

      public void write(char[] chars, int offset, int count) throws IOException
      Append a sub-array of characters to the console.
      Specified by:
      write in class Writer
      Parameters:
      chars - Array of characters.
      offset - Index of the first character of the sub-array.
      count - Specifies the length of the sub-array to write.
      Throws:
      IndexOutOfBoundsException - for invalid offset and count.
      IOException - If an I/O error occurs.
    • clear

      public void clear()
      Clear the text area document.
    • close

      public void close() throws IOException
      Close the text area document.
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
      Specified by:
      close in class Writer
      Throws:
      IOException - When JTextArea document cannot be closed.
    • flush

      public void flush() throws IOException
      Flush the text area document.
      Specified by:
      flush in interface Flushable
      Specified by:
      flush in class Writer
      Throws:
      IOException