jess.swing
Class JTextAreaWriter

java.lang.Object
  extended by java.io.Writer
      extended by jess.swing.JTextAreaWriter
All Implemented Interfaces:
java.io.Closeable, java.io.Flushable, java.io.Serializable, java.lang.Appendable

public class JTextAreaWriter
extends java.io.Writer
implements java.io.Serializable

A simple Writer, suitable for constructing a PrintWriter, which uses a JTextArea as its output. This class is a convenient way to write a GUI in which Jess prints its output to a text widget. Contents are kept to a maximum of 32000 characters, assuming that no other code appends to this JTextArea.

(C) 2013 Sandia Corporation

See Also:
TextAreaWriter, Serialized Form

Field Summary
 
Fields inherited from class java.io.Writer
lock
 
Constructor Summary
JTextAreaWriter(javax.swing.JTextArea area)
          Call this with an already constructed TextArea object, which you can put wherever you'd like.
 
Method Summary
 void clear()
           
 void close()
          Does nothing
 void flush()
          Flushes pending output to the TextArea.
 void write(char[] b, int off, int len)
          Writes a portion of an array of characters to the TextArea.
 
Methods inherited from class java.io.Writer
append, append, append, write, write, write, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JTextAreaWriter

public JTextAreaWriter(javax.swing.JTextArea area)
Call this with an already constructed TextArea object, which you can put wherever you'd like.

Parameters:
area - The text area
Method Detail

clear

public void clear()

close

public void close()
Does nothing

Specified by:
close in interface java.io.Closeable
Specified by:
close in class java.io.Writer

flush

public void flush()
Flushes pending output to the TextArea.

Specified by:
flush in interface java.io.Flushable
Specified by:
flush in class java.io.Writer

write

public void write(char[] b,
                  int off,
                  int len)
Writes a portion of an array of characters to the TextArea. No output is actually done until flush() is called.

Specified by:
write in class java.io.Writer
Parameters:
b - The array of characters
off - The first character in the array to write
len - The number of characters form the array to write
See Also:
flush()

2013 Sandia Corporation