| java.lang.Object java.io.Writer com.anthonyeden.lib.io.JTextAreaWriter
JTextAreaWriter | public class JTextAreaWriter extends Writer (Code) | | A implementation of the java.io.Writer class which provides writing to a
JTextArea via a stream.
Note: There appears to be bug in the Macintosh implementation of
the JDK 1.1 where a PrintWriter writing to this class will not include the
correct line feeds for display in a JTextArea. There is a simple test of
the "java.version" system property which, if it starts with the String "1.1"
will cause newlines to be written each time the buffer is flushed.
author: Anthony Eden |
Method Summary | |
public void | close() Close the stream. | public void | flush() Flush the data that is currently in the buffer. | protected StringBuffer | getBuffer() Get the StringBuffer which holds the data prior to writing via
a call to the flush() method. | public void | setTextArea(JTextArea textArea) Set the JTextArea to write to. | public void | write(char[] charArray) Write the given character array to the output stream. | public void | write(char[] charArray, int offset, int length) Write the given character array to the output stream beginning from
the given offset and proceeding to until the given length is reached. | public void | write(int c) Write the given character to the output stream. | public void | write(String string) Write the given String to the output stream. | public void | write(String string, int offset, int length) Write the given String to the output stream beginning from the given offset
and proceeding to until the given length is reached. |
JTextAreaWriter | public JTextAreaWriter(JTextArea textArea)(Code) | | Constructor.
Parameters: textArea - The JTextArea to write to. |
close | public void close()(Code) | | Close the stream.
|
getBuffer | protected StringBuffer getBuffer()(Code) | | Get the StringBuffer which holds the data prior to writing via
a call to the flush() method. This method should
never return null.
A StringBuffer |
setTextArea | public void setTextArea(JTextArea textArea)(Code) | | Set the JTextArea to write to.
Parameters: textArea - The JTextArea |
write | public void write(char[] charArray) throws IOException(Code) | | Write the given character array to the output stream.
Parameters: charArray - The character array throws: IOException - |
write | public void write(char[] charArray, int offset, int length) throws IOException(Code) | | Write the given character array to the output stream beginning from
the given offset and proceeding to until the given length is reached.
Parameters: charArray - The character array Parameters: offset - The start offset Parameters: length - The length to write throws: IOException - |
write | public void write(int c) throws IOException(Code) | | Write the given character to the output stream.
Parameters: c - The character throws: IOException - |
write | public void write(String string, int offset, int length) throws IOException(Code) | | Write the given String to the output stream beginning from the given offset
and proceeding to until the given length is reached.
Parameters: string - The String Parameters: offset - The start offset Parameters: length - The length to write throws: IOException - |
|
|