|
|||||||
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.MessageBox
This dialog is for displaying a single line of text. This dialog is intended for displaying a short warning or error message. The width of this dialog is adjusted to fit the displayed message and the dialog is placed at the center of the screen.
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 | |
MessageBox()
Default constructor. |
|
MessageBox(java.awt.Frame owner)
Creates a MessageBox with the designated owner. |
|
MessageBox(java.awt.Frame owner,
boolean modal)
Creates a MessageBox box with the designated owner and modality. |
Method Summary | |
void |
actionPerformed(java.awt.event.ActionEvent e)
Implements the required method of the ActionListener. |
protected void |
adjustSize()
Place the label and button and adjust the dialog dimension |
void |
keyPressed(java.awt.event.KeyEvent e)
Implements the required method of the KeyListener. |
void |
keyReleased(java.awt.event.KeyEvent e)
Implements the required method of the KeyListener. |
void |
keyTyped(java.awt.event.KeyEvent e)
Implements the required method of the KeyListener. |
void |
show(char character)
Displays the char value after converting it to a string. |
void |
show(char character,
int x,
int y)
Displays the char value after converting it to a string. |
void |
show(double number)
Displays the real number after converting it to a string. |
void |
show(double number,
int x,
int y)
Displays the real number after converting it to a string. |
void |
show(long number)
Displays the integer value after converting it to a string. |
void |
show(long number,
int x,
int y)
Displays the integer value after converting it to a string. |
void |
show(java.lang.String text)
Displays the String value. |
void |
show(java.lang.StringBuffer text)
Displays the StringBuffer value after conveting it to a string. |
void |
show(java.lang.StringBuffer text,
int x,
int y)
Displays the StringBuffer value after conveting it to a string. |
void |
show(java.lang.String text,
int x,
int y)
Displays the String value. |
Methods inherited from class javabook.JavaBookDialog |
moveToCenter,
setVisible,
windowActivated,
windowClosed,
windowClosing,
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,
setFont,
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 MessageBox()
public MessageBox(java.awt.Frame owner)
owner
- Frame object that owns this MessageBoxpublic MessageBox(java.awt.Frame owner, boolean modal)
owner
- Frame object that owns this MessageBoxmodal
- true for modal and false for modeless MessageBoxMethod Detail |
public void actionPerformed(java.awt.event.ActionEvent e)
e
- the ActionEvent object.public void keyTyped(java.awt.event.KeyEvent e)
e
- the KeyEvent object.public void keyPressed(java.awt.event.KeyEvent e)
e
- the KeyEvent object.public void keyReleased(java.awt.event.KeyEvent e)
e
- the KeyEvent object.public void show(char character)
character
- the char value to displaypublic void show(long number)
number
- the integer value to displaypublic void show(double number)
number
- the real value to displaypublic void show(java.lang.String text)
text
- the String value to displaypublic void show(java.lang.StringBuffer text)
text
- the StringBuffer value to displaypublic void show(char character, int x, int y)
character
- the char value to displayx
- the x-coordinate of the dialog positiony
- the y-coordinate of the dialog positionpublic void show(long number, int x, int y)
number
- the integer value to displayx
- the x-coordinate of the dialog positiony
- the y-coordinate of the dialog positionpublic void show(double number, int x, int y)
number
- the real value to displayx
- the x-coordinate of the dialog positiony
- the y-coordinate of the dialog positionpublic void show(java.lang.String text, int x, int y)
text
- the String value to displayx
- the x-coordinate of the dialog positiony
- the y-coordinate of the dialog positionpublic void show(java.lang.StringBuffer text, int x, int y)
text
- the StringBuffer value to displayx
- the x-coordinate of the dialog positiony
- the y-coordinate of the dialog positionprotected void adjustSize()
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |