|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.awt.Component | +--java.awt.Container | +--javax.swing.JComponent | +--javax.swing.JPanel | +--org.thdl.util.StatusBar
A StatusBar can be added to a component, typically to the bottom of it, in order to show the user the status of the program. There are methods to change the status, and there are actually a LIFO stack of status messages if you wish to use them.
Field Summary | |
private JLabel |
label
|
private Stack |
statuses
The current status is the String on top of the stack. |
Fields inherited from class javax.swing.JPanel |
|
Fields inherited from class javax.swing.JComponent |
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
Fields inherited from class java.awt.Container |
|
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 | |
StatusBar()
Creates a status bar. |
|
StatusBar(String msg)
Creates a status bar with the initial message msg. |
Method Summary | |
String |
currentStatus()
Returns the String currently displayed in the status bar. |
private String |
getMsgOnTopOfStack()
Returns the status message on top of the stack, or "" if the stack is empty. |
void |
popStatus()
Removes the current status message. |
void |
pushStatus(String msg)
Sets the status to msg, leaving the previous status on the stack. |
void |
replaceStatus(String msg)
Sets the status to msg, replacing the current status message. |
private void |
updateLabel()
Sets the displayed text to what's on top of the stack, or "" if the stack is empty. |
Methods inherited from class javax.swing.JPanel |
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
private Stack statuses
private JLabel label
Constructor Detail |
public StatusBar()
public StatusBar(String msg)
Method Detail |
public void replaceStatus(String msg) throws NullPointerException
NullPointerException
public void pushStatus(String msg) throws NullPointerException
NullPointerException
public void popStatus()
NullPointerException
- if msg is nullpublic String currentStatus()
private String getMsgOnTopOfStack()
private void updateLabel()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |