|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.awt.Component
java.awt.Container
java.awt.Window
java.awt.Dialog
javax.swing.JDialog
javabook.OutputBox
This dialog is for displaying the program output. You can save the output to a designated file with using either appendToFile or saveToFile.
This class is provided as freeware. You are free to use as provided or modify to your heart's content. But you use it at your own risk. No implied or explicit warranty is given.
Field Summary |
Fields inherited from class java.awt.Component |
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
Fields inherited from interface javax.swing.WindowConstants |
DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, EXIT_ON_CLOSE, HIDE_ON_CLOSE |
Fields inherited from interface java.awt.image.ImageObserver |
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
OutputBox(java.awt.Frame owner)
Constructs a OutputBox whose dimension owning frame is the parameter owner. |
|
OutputBox(java.awt.Frame owner,
int width,
int height)
Constructs a OutputBox whose dimension is the parameters width and height and the owning frame is the parameter owner. |
|
OutputBox(java.awt.Frame owner,
int width,
int height,
java.lang.String title)
Constructs a OutputBox whose dimension is set the parameters width and height, window title is set to the parameter title, and the owning frame to the parameter owner. |
|
OutputBox(java.awt.Frame owner,
java.lang.String title)
Constructs a OutputBox whose window title is the parameter title, and the owning frame is the parameter owner. |
Method Summary | |
void |
appendToFile(java.lang.String fileName)
Appends the content of this dialog to filename. |
void |
clear()
Implements the required method of the ActionListener. |
void |
print(boolean b)
Prints out boolean b. |
void |
print(char ch)
Prints out char ch. |
void |
print(double number)
Prints out a real number. |
void |
print(long number)
Prints out an integer number. |
void |
print(java.lang.String text)
Prints out text. |
void |
print(java.lang.StringBuffer strBuf)
Prints out strBuf. |
void |
printLine(boolean b)
Prints out boolean b and moves the cursor to the next line. |
void |
printLine(char ch)
Prints out char ch and moves the cursor to the next line. |
void |
printLine(double number)
Prints out a real number and moves the cursor to the next line. |
void |
printLine(long number)
Prints out an integer number and moves the cursor to the next line. |
void |
printLine(java.lang.String text)
Prints out text and moves the cursor to the next line. |
void |
printLine(java.lang.StringBuffer strBuf)
Prints out strBuf and moves the cursor to the next line. |
void |
println(boolean b)
Prints out boolean b and moves the cursor to the next line. |
void |
println(char ch)
Prints out char ch and moves the cursor to the next line. |
void |
println(double number)
Prints out a real number and moves the cursor to the next line. |
void |
println(long number)
Prints out an integer number and moves the cursor to the next line. |
void |
println(java.lang.String text)
Prints out text and moves the cursor to the next line. |
void |
println(java.lang.StringBuffer strBuf)
Prints out strBuf and moves the cursor to the next line. |
void |
saveToFile(java.lang.String fileName)
Saves the content of this dialog to fileName. |
void |
setFont(java.awt.Font font)
Sets the font of this dialog to the parameter font. |
void |
skipLine(int numberOfLines)
Skips the numberOfLines lines. |
void |
waitUntilClose()
Changes this dialog to modal and thereby causes the program execution to pause until this dialog is closed. |
Methods inherited from class javax.swing.JDialog |
getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getJMenuBar, getLayeredPane, getRootPane, isDefaultLookAndFeelDecorated, remove, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setJMenuBar, setLayeredPane, setLayout, update |
Methods inherited from class java.awt.Dialog |
addNotify, dispose, getTitle, hide, isModal, isResizable, isUndecorated, setModal, setResizable, setTitle, setUndecorated, show |
Methods inherited from class java.awt.Window |
addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getGraphicsConfiguration, getInputContext, getListeners, getLocale, getMostRecentFocusOwner, getOwnedWindows, getOwner, getToolkit, getWarningString, getWindowFocusListeners, getWindowListeners, getWindowStateListeners, isActive, isFocusableWindow, isFocusCycleRoot, isFocused, isShowing, pack, postEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, setCursor, setFocusableWindowState, setFocusCycleRoot, setLocationRelativeTo, toBack, toFront |
Methods inherited from class java.awt.Container |
add, add, add, add, add, addContainerListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paint, paintComponents, preferredSize, print, printComponents, remove, removeAll, removeContainerListener, removeNotify, setFocusTraversalKeys, setFocusTraversalPolicy, transferFocusBackward, transferFocusDownCycle, validate |
Methods inherited from class java.awt.Component |
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, dispatchEvent, enable, enable, enableInputMethods, getBackground, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isOpaque, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocusInWindow, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, size, toString, transferFocus, transferFocusUpCycle |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public OutputBox(java.awt.Frame owner, int width, int height, java.lang.String title)
owner
- the owning Frame objectwidth
- the width of this dialogheight
- the height of this dialogtitle
- the window title of this dialogpublic OutputBox(java.awt.Frame owner, int width, int height)
owner
- the owning Frame objectwidth
- the width of this dialogheight
- the height of this dialogpublic OutputBox(java.awt.Frame owner, java.lang.String title)
owner
- the owning Frame objecttitle
- the window title of this dialogpublic OutputBox(java.awt.Frame owner)
owner
- the owning Frame objectMethod Detail |
public void appendToFile(java.lang.String fileName)
fileName
- the name of the file to save the content of this dialogpublic void clear()
public void print(boolean b)
b
- boolean data to outputpublic void print(char ch)
ch
- char data to outputpublic void print(double number)
number
- real number value to outputpublic void print(long number)
number
- integer value to outputpublic void print(java.lang.String text)
text
- String object to outputpublic void print(java.lang.StringBuffer strBuf)
strBuf
- StringBuffer object to outputpublic void printLine(boolean b)
b
- boolean data to outputpublic void printLine(char ch)
ch
- char data to outputpublic void printLine(double number)
number
- real number value to outputpublic void printLine(long number)
number
- integer value to outputpublic void printLine(java.lang.String text)
text
- String object to outputpublic void printLine(java.lang.StringBuffer strBuf)
strBuf
- StringBuffer object to outputpublic void println(boolean b)
b
- boolean data to outputpublic void println(char ch)
ch
- char data to outputpublic void println(double number)
number
- real number value to outputpublic void println(long number)
number
- integer value to outputpublic void println(java.lang.String text)
text
- String object to outputpublic void println(java.lang.StringBuffer strBuf)
strBuf
- StringBuffer object to outputpublic void saveToFile(java.lang.String fileName)
fileName
- the name of file to save the content of this dialog.public void setFont(java.awt.Font font)
font
- the new font to use for subsequent outputpublic void skipLine(int numberOfLines)
numberOfLines
- the number of lines to skippublic void waitUntilClose()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |