CSLib
Class OutputBox

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--java.awt.Window
                    |
                    +--java.awt.Frame
                          |
                          +--CSLib.ClosableFrame
                                |
                                +--CSLib.OutputBox

public class OutputBox
extends ClosableFrame

OutputBox is a closable frame that holds textual output.
It mimics Java's java.lang.System.out, which is
a java.io.PrintStream.

Author:
M. Dennis Mickunas
See Also: PrintStream, TextArea

Fields inherited from class java.awt.Frame
DEFAULT_CURSOR, CROSSHAIR_CURSOR, TEXT_CURSOR, WAIT_CURSOR, SW_RESIZE_CURSOR, SE_RESIZE_CURSOR, NW_RESIZE_CURSOR, NE_RESIZE_CURSOR, N_RESIZE_CURSOR, S_RESIZE_CURSOR, W_RESIZE_CURSOR, E_RESIZE_CURSOR, HAND_CURSOR, MOVE_CURSOR, NORMAL, ICONIFIED

Fields inherited from class java.awt.Component
TOP_ALIGNMENT, CENTER_ALIGNMENT, BOTTOM_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT

Constructor Summary
OutputBox()
          Constructs an OutputBox with a default title.
OutputBox(String title)
          Constructs an OutputBox with a specific title.

Method Summary
 voidclear()
          Erases the text in the OutputBox.
 voidprint(String text)
          Prints a string.
 voidprint(int number)
          Prints an integer.
 voidprint(float number)
          Prints a floating-point number.
 voidprint(double number)
          Prints a double-precision floating-point number.
 voidprint(boolean b)
          Prints a boolean value.
 voidprint(char c)
          Prints a character.
 voidprint(long number)
          Prints a long integer.
 voidprint(StringBuffer strBuf)
          Prints a string buffer.
 voidprintln()
          Terminates the current line by writing a carriage return character
followed by a newline character.
 voidprintln(String text)
          Prints a String and then terminates the line.
 voidprintln(int number)
          Prints an integer and then terminates the line.
 voidprintln(float number)
          Prints a float and then terminates the line.
 voidprintln(double number)
          Prints a double and then terminates the line.
 voidprintln(boolean b)
          Prints a boolean and then terminates the line.
 voidprintln(char c)
          Print a character and then terminate the line.
 voidprintln(long number)
          Prints a long and then terminates the line.
 voidprintln(StringBuffer strBuf)
          Prints a string buffer and then terminates the line.
 voidsetFont(Font font)
          Changes the font for subsequent printing.

Methods inherited from class CSLib.ClosableFrame
windowActivated, windowClosed, windowClosing, windowDeactivated, windowDeiconified, windowIconified, windowOpened

Methods inherited from class java.awt.Frame
addNotify, getTitle, setTitle, getIconImage, setIconImage, getMenuBar, setMenuBar, isResizable, setResizable, setState, getState, remove, removeNotify, setCursor, getCursorType, getFrames, getAccessibleContext

Methods inherited from class java.awt.Window
pack, show, hide, dispose, toFront, toBack, getToolkit, getWarningString, getLocale, getInputContext, setCursor, getOwner, getOwnedWindows, addWindowListener, removeWindowListener, getListeners, getFocusOwner, postEvent, isShowing, applyResourceBundle, applyResourceBundle, getGraphicsConfiguration

Methods inherited from class java.awt.Container
getComponentCount, countComponents, getComponent, getComponents, getInsets, insets, add, add, add, add, add, remove, remove, removeAll, getLayout, setLayout, doLayout, layout, invalidate, validate, getPreferredSize, preferredSize, getMinimumSize, minimumSize, getMaximumSize, getAlignmentX, getAlignmentY, paint, update, print, paintComponents, printComponents, addContainerListener, removeContainerListener, deliverEvent, getComponentAt, locate, getComponentAt, findComponentAt, findComponentAt, isAncestorOf, list, list

Methods inherited from class java.awt.Component
getName, setName, getParent, getPeer, setDropTarget, getDropTarget, getTreeLock, isValid, isDisplayable, isVisible, isEnabled, setEnabled, enable, enable, disable, isDoubleBuffered, enableInputMethods, setVisible, show, getForeground, setForeground, getBackground, setBackground, getFont, setLocale, getColorModel, getLocation, getLocationOnScreen, location, setLocation, move, setLocation, getSize, size, setSize, resize, setSize, resize, getBounds, bounds, setBounds, reshape, setBounds, getX, getY, getWidth, getHeight, getBounds, getSize, getLocation, isOpaque, isLightweight, getGraphics, getFontMetrics, getCursor, paintAll, repaint, repaint, repaint, repaint, printAll, imageUpdate, createImage, createImage, prepareImage, prepareImage, checkImage, checkImage, contains, inside, contains, dispatchEvent, addComponentListener, removeComponentListener, addFocusListener, removeFocusListener, addHierarchyListener, removeHierarchyListener, addHierarchyBoundsListener, removeHierarchyBoundsListener, addKeyListener, removeKeyListener, addMouseListener, removeMouseListener, addMouseMotionListener, removeMouseMotionListener, addInputMethodListener, removeInputMethodListener, getInputMethodRequests, handleEvent, mouseDown, mouseDrag, mouseUp, mouseMove, mouseEnter, mouseExit, keyDown, keyUp, action, gotFocus, lostFocus, isFocusTraversable, requestFocus, transferFocus, nextFocus, hasFocus, add, toString, list, list, list, addPropertyChangeListener, removePropertyChangeListener, addPropertyChangeListener, removePropertyChangeListener, setComponentOrientation, getComponentOrientation

Methods inherited from class java.lang.Object
getClass, hashCode, equals, notify, notifyAll, wait, wait, wait

Constructor Detail

OutputBox

public OutputBox()
Constructs an OutputBox with a default title.

OutputBox

public OutputBox(String title)
Constructs an OutputBox with a specific title.
Parameters:
title the specific String to use as the title
Method Detail

clear

public void clear()
Erases the text in the OutputBox.

print

public void print(String text)
Prints a string. The string printed is just what would be
printed by java.lang.System.out.print(String).
Parameters:
text the String to be printed

print

public void print(int number)
Prints an integer. The string printed is just what would be
printed by java.lang.System.out.print(int).
Parameters:
number the int to be printed

print

public void print(float number)
Prints a floating-point number. The string printed is just what would be
printed by java.lang.System.out.print(float).
Parameters:
number the float to be printed

print

public void print(double number)
Prints a double-precision floating-point number. The string
printed is just what would be printed by
java.lang.System.out.print(double).
Parameters:
number the double to be printed

print

public void print(boolean b)
Prints a boolean value. The string printed is just what would be
printed by java.lang.System.out.print(boolean).
Parameters:
b the boolean to be printed

print

public void print(char c)
Prints a character. The string printed is just what would be
printed by java.lang.System.out.print(char).
Parameters:
c the char to be printed

print

public void print(long number)
Prints a long integer. The string printed is just what would be
printed by java.lang.System.out.print(long).
Parameters:
number the long to be printed

print

public void print(StringBuffer strBuf)
Prints a string buffer. The string printed is just what would be
printed by java.lang.System.out.print(StringBuffer).
Parameters:
strBuf the StringBuffer to be printed
See Also:
java.lang.StringBuffer.toString()

println

public void println()
Terminates the current line by writing a carriage return character
followed by a newline character.

println

public void println(String text)
Prints a String and then terminates the line. This method
invokes print(String) and then println().
Parameters:
number the String to be printed.

println

public void println(int number)
Prints an integer and then terminates the line. This method behaves as
though it invokes print(int) and then
println().
Parameters:
number the int to be printed.

println

public void println(float number)
Prints a float and then terminates the line. This method behaves as
though it invokes print(float) and then
println().
Parameters:
number the float to be printed.

println

public void println(double number)
Prints a double and then terminates the line. This method behaves as
though it invokes print(double) and then
println().
Parameters:
number the double to be printed.

println

public void println(boolean b)
Prints a boolean and then terminates the line. This method behaves as
though it invokes print(boolean) and then
println().
Parameters:
b the boolean to be printed

println

public void println(char c)
Print a character and then terminate the line. This method behaves as
though it invokes print(char) and then
println().
Parameters:
c the char to be printed.

println

public void println(long number)
Prints a long and then terminates the line. This method behaves as
though it invokes print(long) and then
println().
Parameters:
number The long to be printed.

println

public void println(StringBuffer strBuf)
Prints a string buffer and then terminates the line. This method behaves
as though it invokes print(StringBuffer) and then
println().
Parameters:
strBuf the StringBuffer to be printed

setFont

public void setFont(Font font)
Changes the font for subsequent printing.
Parameters:
font the specific Font to change to.

Association Links

to Class java.awt.TextArea

the area where output is printed

to Class java.awt.Font