jess.swing
Class JTextAreaWriter

java.lang.Object
  extended byjava.io.Writer
      extended byjess.swing.JTextAreaWriter
All Implemented Interfaces:
java.io.Serializable

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) 2006 Sandia National Laboratories

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
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


flush

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


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.

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()

© 2007 Sandia Corporation