|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.awt.Component | +--java.awt.Container | +--java.awt.Window | +--java.awt.Dialog | +--javabook.JavaBookDialog | +--javabook.OutputBox
This dialog is for displaying the program output. You can save the output to a designated file by 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.
Fields inherited from class javabook.JavaBookDialog |
font,
wasMoved |
Fields inherited from class java.awt.Component |
BOTTOM_ALIGNMENT,
CENTER_ALIGNMENT,
LEFT_ALIGNMENT,
RIGHT_ALIGNMENT,
TOP_ALIGNMENT |
Constructor Summary | |
OutputBox()
Default constructor. |
|
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 | |
protected void |
adjustSize()
Adjust the size of this dialog based on the components it contains. |
protected void |
adjustSize(int width,
int height)
Adjust the size of this dialog based on the components it contains. |
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 |
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. |
void |
windowClosing(java.awt.event.WindowEvent e)
Overrides the inherited method. |
Methods inherited from class javabook.JavaBookDialog |
moveToCenter,
setVisible,
windowActivated,
windowClosed,
windowDeactivated,
windowDeiconified,
windowIconified,
windowOpened |
Methods inherited from class java.awt.Dialog |
addNotify,
dispose,
getTitle,
hide,
isModal,
isResizable,
paramString,
setModal,
setResizable,
setTitle,
show |
Methods inherited from class java.awt.Window |
addWindowListener,
applyResourceBundle,
applyResourceBundle,
finalize,
getFocusOwner,
getInputContext,
getLocale,
getOwnedWindows,
getOwner,
getToolkit,
getWarningString,
isShowing,
pack,
postEvent,
processEvent,
processWindowEvent,
removeWindowListener,
setCursor,
toBack,
toFront |
Methods inherited from class java.awt.Container |
add,
add,
add,
add,
add,
addContainerListener,
addImpl,
countComponents,
deliverEvent,
doLayout,
findComponentAt,
findComponentAt,
getAlignmentX,
getAlignmentY,
getComponent,
getComponentAt,
getComponentAt,
getComponentCount,
getComponents,
getInsets,
getLayout,
getMaximumSize,
getMinimumSize,
getPreferredSize,
insets,
invalidate,
isAncestorOf,
layout,
list,
list,
locate,
minimumSize,
paint,
paintComponents,
preferredSize,
print,
printComponents,
processContainerEvent,
remove,
remove,
removeAll,
removeContainerListener,
removeNotify,
setLayout,
update,
validate,
validateTree |
Methods inherited from class java.awt.Component |
action,
add,
addComponentListener,
addFocusListener,
addInputMethodListener,
addKeyListener,
addMouseListener,
addMouseMotionListener,
addPropertyChangeListener,
addPropertyChangeListener,
bounds,
checkImage,
checkImage,
coalesceEvents,
contains,
contains,
createImage,
createImage,
disable,
disableEvents,
dispatchEvent,
enable,
enable,
enableEvents,
enableInputMethods,
firePropertyChange,
getBackground,
getBounds,
getBounds,
getColorModel,
getComponentOrientation,
getCursor,
getDropTarget,
getFont,
getFontMetrics,
getForeground,
getGraphics,
getHeight,
getInputMethodRequests,
getLocation,
getLocation,
getLocationOnScreen,
getName,
getParent,
getPeer,
getSize,
getSize,
getTreeLock,
getWidth,
getX,
getY,
gotFocus,
handleEvent,
hasFocus,
imageUpdate,
inside,
isDisplayable,
isDoubleBuffered,
isEnabled,
isFocusTraversable,
isLightweight,
isOpaque,
isValid,
isVisible,
keyDown,
keyUp,
list,
list,
list,
location,
lostFocus,
mouseDown,
mouseDrag,
mouseEnter,
mouseExit,
mouseMove,
mouseUp,
move,
nextFocus,
paintAll,
prepareImage,
prepareImage,
printAll,
processComponentEvent,
processFocusEvent,
processInputMethodEvent,
processKeyEvent,
processMouseEvent,
processMouseMotionEvent,
remove,
removeComponentListener,
removeFocusListener,
removeInputMethodListener,
removeKeyListener,
removeMouseListener,
removeMouseMotionListener,
removePropertyChangeListener,
removePropertyChangeListener,
repaint,
repaint,
repaint,
repaint,
requestFocus,
reshape,
resize,
resize,
setBackground,
setBounds,
setBounds,
setComponentOrientation,
setDropTarget,
setEnabled,
setForeground,
setLocale,
setLocation,
setLocation,
setName,
setSize,
setSize,
show,
size,
toString,
transferFocus |
Methods inherited from class java.lang.Object |
clone,
equals,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
Constructor Detail |
public OutputBox()
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()
e
- the ActionEvent object.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 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()
public void windowClosing(java.awt.event.WindowEvent e)
e
- the WindowEvent object.protected void adjustSize(int width, int height)
width
- the width of this dialogheight
- the height of this dialogprotected void adjustSize()
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |