|
|||||||||
| 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
anecho.gui.OKBox
public class OKBox
The Reusable dialogue box: OKBox.java displays program messages to the user with the possibility of including icons, text, and/or response buttons
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class java.awt.Dialog |
|---|
java.awt.Dialog.AccessibleAWTDialog |
| Nested classes/interfaces inherited from class java.awt.Window |
|---|
java.awt.Window.AccessibleAWTWindow |
| Nested classes/interfaces inherited from class java.awt.Container |
|---|
java.awt.Container.AccessibleAWTContainer |
| Nested classes/interfaces inherited from class java.awt.Component |
|---|
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy |
| Field Summary | |
|---|---|
static int |
ALERT_ICON
Show an "Alert" icon in the message box. |
static java.lang.String |
CANCEL
Cancel Button |
static int |
CUSTOM_ICON
Show a custom icon in the dialogue box. |
static int |
INFORMATION_ICON
Show an "information" icon in the dialogue box. |
static int |
NO_ICON
Do not show an icon in the message box |
static java.lang.String |
OKAY
Okay button |
static int |
QUESTION_ICON
Show a custom icon in the message box |
| Fields inherited from class java.awt.Component |
|---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
| Fields inherited from interface java.awt.image.ImageObserver |
|---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
| Constructor Summary | |
|---|---|
OKBox(java.awt.Frame parent)
The Reusable dialogue box: OKBox.java displays program messages to the user with the possibility of including icons, text, and/or response buttons |
|
OKBox(java.awt.Frame parent,
boolean modalBox)
The Reusable dialogue box: OKBox.java displays program messages to the user with the possibility of including icons, text, and/or response buttons |
|
OKBox(java.awt.Frame parent,
java.lang.String title)
The Reusable dialogue box: OKBox.java displays program messages to the user with the possibility of including icons, text, and/or response buttons |
|
OKBox(java.awt.Frame parent,
java.lang.String title,
boolean modalBox)
The Reusable dialogue box: OKBox.java displays program messages to the user with the possibility of including icons, text, and/or response buttons |
|
OKBox(java.awt.Frame parent,
java.lang.String title,
boolean modalBox,
java.lang.String boxMessage)
The Reusable dialogue box: OKBox.java displays program messages to the user with the possibility of including icons, text, and/or response buttons |
|
OKBox(java.awt.Frame parent,
java.lang.String title,
boolean modalBox,
java.lang.String boxMessage,
int iconType)
The Reusable dialogue box: OKBox.java displays program messages to the user with the possibility of including icons, text, and/or response buttons |
|
OKBox(java.awt.Frame parent,
java.lang.String title,
boolean modalBox,
java.lang.String boxMessage,
int iconType,
java.lang.String buttons)
The Reusable dialogue box: OKBox.java displays program messages to the user with the possibility of including icons, text, and/or response buttons |
|
OKBox(java.awt.Frame parent,
java.lang.String title,
boolean modalBox,
java.lang.String boxMessage,
java.lang.String buttons)
The Reusable dialogue box: OKBox.java displays program messages to the user with the possibility of including icons, text, and/or response buttons |
|
| Method Summary | |
|---|---|
void |
actionPerformed(java.awt.event.ActionEvent event)
This method captures the button that was pressed by the user and records the information internally. |
void |
addButton(java.lang.String name)
Add a button to the list of buttons to be displayed |
void |
append(java.lang.String text)
Append a line of text to a message, or create a new message if one does not exist |
java.lang.String |
getResult()
Return the user's selection. |
void |
paint(java.awt.Graphics iconGraph)
Paint a given icon to the dialogue |
void |
setText(java.lang.String text)
Set the text for the message (erasing any previous contents) |
void |
setVisible(boolean status)
Allow the dialogue box to be shown or hidden |
void |
show()
Deprecated. This method is deprecated |
void |
showCentered()
This functions the same as the show command except for the fact that it automatically centres the dialogue over its parent |
void |
showCentred()
Deprecated. use showCentered() instead |
| Methods inherited from class java.awt.Dialog |
|---|
addNotify, getAccessibleContext, getTitle, hide, isModal, isResizable, isUndecorated, paramString, setModal, setResizable, setTitle, setUndecorated |
| Methods inherited from class java.awt.Window |
|---|
addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, dispose, finalize, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getGraphicsConfiguration, getInputContext, getListeners, getLocale, getMostRecentFocusOwner, getOwnedWindows, getOwner, getToolkit, getWarningString, getWindowFocusListeners, getWindowListeners, getWindowStateListeners, isActive, isAlwaysOnTop, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isShowing, pack, postEvent, processEvent, processWindowEvent, processWindowFocusEvent, processWindowStateEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, setAlwaysOnTop, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setLocationByPlatform, setLocationRelativeTo, toBack, toFront |
| Methods inherited from class java.awt.Container |
|---|
add, add, add, add, add, addContainerListener, addImpl, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, remove, removeAll, removeContainerListener, removeNotify, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, setLayout, transferFocusBackward, transferFocusDownCycle, update, validate, validateTree |
| Methods inherited from class java.awt.Component |
|---|
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, 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, getMousePosition, 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, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, setBackground, setBounds, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setMinimumSize, setName, setPreferredSize, setSize, setSize, show, size, toString, transferFocus, transferFocusUpCycle |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final int NO_ICON
public static final int CUSTOM_ICON
public static final int QUESTION_ICON
public static final int ALERT_ICON
public static final int INFORMATION_ICON
public static final java.lang.String OKAY
public static final java.lang.String CANCEL
| Constructor Detail |
|---|
public OKBox(java.awt.Frame parent)
parent - The parent frame for this dialogue
public OKBox(java.awt.Frame parent,
boolean modalBox)
parent - The parent frame for this dialoguemodalBox - Indicate the modal status of this dialogue
true - Dialogue is modal
false - Dialogue is non-modal
public OKBox(java.awt.Frame parent,
java.lang.String title)
title - Title to be used for this dialogueparent - The parent frame for this dialogue
public OKBox(java.awt.Frame parent,
java.lang.String title,
boolean modalBox)
parent - The parent frame of this dialoguetitle - The title for this dialogmodalBox - Indicate the modal status of this dialogue
true - Dialogue is modal
false - Dialogue is non-modal
public OKBox(java.awt.Frame parent,
java.lang.String title,
boolean modalBox,
java.lang.String boxMessage)
title - Title of this dialogueboxMessage - Message to be displayed in this dialogueparent - The parent frame for this dialoguemodalBox - Indicate the modal status of this dialogue
true - Dialogue is modal
false - Dialogue is non-modal
public OKBox(java.awt.Frame parent,
java.lang.String title,
boolean modalBox,
java.lang.String boxMessage,
int iconType)
title - Title of this dialogueboxMessage - Message to be displayed by this dialogueiconType - The type of icon to be displayed by this dialogueparent - The parent frame for this dialoguemodalBox - Indicate the modal status of this dialogue
true - Dialogue is modal
false - Dialogue is non-modal
public OKBox(java.awt.Frame parent,
java.lang.String title,
boolean modalBox,
java.lang.String boxMessage,
java.lang.String buttons)
title - The title to be displayed by this dialogueboxMessage - The message to be displayed by this dialoguebuttons - The buttons to be displayed on this dialogue box.parent - The parent frame for this dialoguemodalBox - Indicate the modal status of this dialogue
true - Dialogue is modal
false - Dialogue is non-modal
public OKBox(java.awt.Frame parent,
java.lang.String title,
boolean modalBox,
java.lang.String boxMessage,
int iconType,
java.lang.String buttons)
title - The title to be used by this dialogue boxboxMessage - The message to be displayed by this dialogue box.iconType - The icon type to be used by this dialoguebuttons - The buttons to be used by this dialogueparent - The parent frame for this dialoguemodalBox - Indicate the modal status of this dialogue
true - Dialogue is modal
false - Dialogue is non-modal| Method Detail |
|---|
public void actionPerformed(java.awt.event.ActionEvent event)
actionPerformed in interface java.awt.event.ActionListenerevent - public void paint(java.awt.Graphics iconGraph)
paint in class java.awt.ContainericonGraph - The graphic area we are working with.public void setText(java.lang.String text)
text - The text to display in our dialogue box.public void addButton(java.lang.String name)
name - Name of the button to add to our dialoguepublic void append(java.lang.String text)
text - Text to be appended to the dialoguepublic java.lang.String getResult()
public void show()
show in class java.awt.Dialogpublic void setVisible(boolean status)
setVisible in class java.awt.Componentstatus - true - make this dialogue visible
false - hide this dialoguepublic void showCentred()
public void showCentered()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||