public class StatusBar extends JPanel implements ActionListener
JPanel.AccessibleJPanel
JComponent.AccessibleJComponent
Container.AccessibleAWTContainer
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
Constructor and Description |
---|
StatusBar()
Default constructor.
|
StatusBar(boolean showProgressBar)
This builds a status-bar with a message panel and optionally
a progress panel with a progress bar, progress text and
a progress cancel button.
|
StatusBar(boolean showProgressText,
boolean showProgressCancel)
This builds a status-bar with a message panel and a progress panel
with a progress bar and optionally a progress text and a progress
cancel button.
|
Modifier and Type | Method and Description |
---|---|
void |
actionPerformed(ActionEvent e) |
void |
addAsLastComponent(JPanel panel)
Adds the panel as the last one to the status bar, just before the gripper.
|
void |
addCancelProgressListener(ActionListener l)
Adds an action listener to the cancel progress button.
|
void |
addToStatusBar(Component c)
Adds a user-defined component to the far left of the status bar, after the
status text(if any).
|
protected JPanel |
createEastPanel()
Create an internal panel, positioned using an east layout constaint,
to hold optional subpanels such as progress bar, connection info, or
user defined panels.
|
protected JPanel |
createGripperPanel()
Creates a GripperPanel.
|
protected JPanel |
createMessagePanel()
Creates a simple message area with the default layout
|
protected JPanel |
createProgressPanel()
A simple progress bar implementation
|
protected void |
init() |
void |
removeCancelProgressListener(ActionListener l)
Removes the given action listener from the cancel progress button.
|
void |
setMessage(String message)
Sets the message to display in the message display area of status bar.
|
void |
setMessage(String message,
int visible)
Sets the message to display in the message display area of status bar.
|
void |
setProgressDefaults(boolean indeterminate,
int start,
int max,
String progressStr)
Sets the progress area defaults.
|
void |
setProgressText(String value)
Set progress text
|
void |
setProgressValue(int value)
Set scalar progress value
|
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate, validateTree
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
public StatusBar()
public StatusBar(boolean showProgressBar)
showProgressBar
- if true, displays the progress bar, the
progress text(if set) and the Cancel buttonpublic StatusBar(boolean showProgressText, boolean showProgressCancel)
showProgressText
- if true, displays the progress text(if set)showProgressCancel
- if true, displays the progress Cancel buttonprotected void init()
protected JPanel createEastPanel()
Gripper panel will always be placed as the last component on this panel.
public void addAsLastComponent(JPanel panel)
Panel background will be set to default status bar background.
panel
- the panel to be set as the last component.protected JPanel createGripperPanel()
protected JPanel createMessagePanel()
protected JPanel createProgressPanel()
public void actionPerformed(ActionEvent e)
actionPerformed
in interface ActionListener
public void setMessage(String message)
message
- Message to display.public void setMessage(String message, int visible)
message
- Message to display.visible
- How long the message should be visible, in seconds. If
less than or equal to zero, the default time-out is usedpublic void addToStatusBar(Component c)
c
- Any componentpublic void setProgressDefaults(boolean indeterminate, int start, int max, String progressStr)
indeterminate
- If true, indeterminate progress bar will be shown.
In that case, the other arguments are ignored. If false,
progress bar with bounds specified by start and max params
will be shown. The progress bar is updated by setProgressValue().start
- Specifies starting value of the progress bar and countermax
- Specifies maximum value of the progress bar and counterprogressStr
- If not null, sets the value of progress string
used in the counter.public void setProgressValue(int value)
value
- Current progress valuepublic void setProgressText(String value)
value
- String to display in the optional progress text areapublic void addCancelProgressListener(ActionListener l)
l
- the action listener to be addedpublic void removeCancelProgressListener(ActionListener l)
l
- the action listener to be removedCopyright © 2003, 2023, Oracle and/or its affiliates.