public class StatusBar extends JPanel
The status bar consists of a left and right side, which can be specified when adding components (or text) to the status bar. Components added to the left side, is oriented right-to-left, meaning that the last element added will be the left-most side of the status bar. The right side is oriented left-to-right, thus the last element added will be at the right-most side of the status bar.
JPanel.AccessibleJPanelJComponent.AccessibleJComponentContainer.AccessibleAWTContainerComponent.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy| Modifier and Type | Field and Description |
|---|---|
static int |
LEFT
Constant denoting the left side of the status bar
|
static int |
RIGHT
Constant denoting the right side of the status bar
|
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOWaccessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENTABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH| Constructor and Description |
|---|
StatusBar()
Default constructor.
|
| Modifier and Type | Method and Description |
|---|---|
Component |
add(Component component)
Adds a component to the left side of the status bar.
|
Component |
add(String msg)
Adds the specified text to the left side of the status bar.
|
Component |
addComponent(Component component,
int ALIGNMENT)
Add a component to the status bar.The alignment must be either
StatusBar.LEFT or StatusBar.RIGHT.
|
Component |
addComponent(Component component,
int ALIGNMENT,
int timer,
boolean bell)
Adds a component to the status bar.
|
Component |
addTextLeft(String msg)
Adds a text to the left of the status bar.
|
Component |
addTextLeft(String msg,
int timer,
boolean bell)
Adds a text to the left side of the status bar.
|
Component |
addTextRight(String msg)
Adds a text to the right of the status bar.
|
Component |
addTextRight(String msg,
int timer,
boolean bell)
Adds a text to the right side of the status bar.
|
void |
removeComponent(Component component)
Removes the specified component from the status bar.
|
void |
removeMessage(String msg)
Removes the specified text message from the status bar.
|
void |
setMessageFont(Font font)
Sets the font used by the message bar when displaying text messages.
|
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUIaddAncestorListener, 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, updateadd, 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, validateTreeaction, 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, transferFocusUpCyclepublic static final int LEFT
public static final int RIGHT
public Component add(Component component)
addComponent(component, StatusBar.LEFT, 0, false)public Component add(String msg)
msg - (missing javadoc)public Component addComponent(Component component, int ALIGNMENT)
component - the component to addALIGNMENT - constant specifying the alignment, either LEFT or RIGHTadd(Component)public Component addComponent(Component component, int ALIGNMENT, int timer, boolean bell)
component - the component to addALIGNMENT - constant specifying the alignment, either LEFT or RIGHTtimer - if greater than zero, the amount in milliseconds the
componet shall be on the status bar.bell - if true the system beeps when the component is
displayedadd(Component)public Component addTextLeft(String msg)
msg - the text to display on the left side of the status bar.public Component addTextRight(String msg)
msg - the text to display on the right side of the status bar.public Component addTextLeft(String msg, int timer, boolean bell)
timer > 0 , the text will stay visible for
timermilliseconds. If bell true
the system beeps when the message is displayed.
The displayed text is displayed on a JLabel. If no font is specified
(using the setFont method, the default font is used.
msg - the text to display on the left side of the status bartimer - if positive, the amount of milliseconds the message will
stay visiblebell - if true the system beeps when the message is displayed.public Component addTextRight(String msg, int timer, boolean bell)
timer > 0 , the text will stay visible for
timermilliseconds. If bell true
the system beeps when the message is displayed.
The displayed text is displayed on a JLabel. If no font is specified
(using the setFont method, the default font is used.
msg - the text to display on the right side of the status bartimer - if positive, the amount of milliseconds the message will
stay visiblebell - if true the system beeps when the message is displayed.public void setMessageFont(Font font)
null the default look-and-feel font is
used.font - the Font used to display text messages.public void removeComponent(Component component)
component - the component that shall be removed.public void removeMessage(String msg)
msg - the text to remove.Copyright © 2006–2020 Esito AS. All rights reserved.