Class ConsoleWriter
java.lang.Object
java.io.Writer
org.patrodyne.jvnet.basicjaxb.explore.ConsoleWriter
- All Implemented Interfaces:
Closeable,Flushable,Appendable,AutoCloseable
This class extends from Writer to redirect output to a JTextArea.
- Author:
- Rick O'Sulllivan
-
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()Clear the text area document.voidclose()Close the text area document.voidflush()Flush the text area document.voidIncrease text font (float) size.voidDecrease text font (float) size.voidwrite(char[] chars, int offset, int count) Append a sub-array of characters to the console.
-
Constructor Details
-
ConsoleWriter
public ConsoleWriter(int points) Construct with built-in, read-only JTextArea.- Parameters:
points- The font size.
-
-
Method Details
-
getTextArea
-
largerText
public void largerText()Increase text font (float) size. -
smallerText
public void smallerText()Decrease text font (float) size. -
write
Append a sub-array of characters to the console.- Specified by:
writein classWriter- 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
Close the text area document.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein classWriter- Throws:
IOException- When JTextArea document cannot be closed.
-
flush
Flush the text area document.- Specified by:
flushin interfaceFlushable- Specified by:
flushin classWriter- Throws:
IOException
-