|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.io.Writer
com.anthonyeden.lib.io.JTextAreaWriter
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.
| Field Summary |
| Fields inherited from class java.io.Writer |
lock |
| Constructor Summary | |
JTextAreaWriter(javax.swing.JTextArea textArea)
Constructor. |
|
| Method Summary | |
void |
close()
Close the stream. |
void |
flush()
Flush the data that is currently in the buffer. |
protected java.lang.StringBuffer |
getBuffer()
Get the StringBuffer which holds the data prior to writing via a call to the flush() method. |
void |
setTextArea(javax.swing.JTextArea textArea)
Set the JTextArea to write to. |
void |
write(char[] charArray)
Write the given character array to the output stream. |
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. |
void |
write(int c)
Write the given character to the output stream. |
void |
write(java.lang.String string)
Write the given String to the output stream. |
void |
write(java.lang.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. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public JTextAreaWriter(javax.swing.JTextArea textArea)
textArea - The JTextArea to write to.| Method Detail |
public void setTextArea(javax.swing.JTextArea textArea)
textArea - The JTextAreapublic void close()
public void flush()
throws java.io.IOException
java.io.IOException
public void write(char[] charArray)
throws java.io.IOException
charArray - The character array
java.io.IOException
public void write(char[] charArray,
int offset,
int length)
throws java.io.IOException
charArray - The character arrayoffset - The start offsetlength - The length to write
java.io.IOException
public void write(int c)
throws java.io.IOException
c - The character
java.io.IOException
public void write(java.lang.String string)
throws java.io.IOException
string - The String
java.io.IOException
public void write(java.lang.String string,
int offset,
int length)
throws java.io.IOException
string - The Stringoffset - The start offsetlength - The length to write
java.io.IOExceptionprotected java.lang.StringBuffer getBuffer()
flush() method. This method should
never return null.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||