All Packages Class Hierarchy This Package Previous Next Index
Class java.awt.swing.JProgressBar
java.lang.Object
|
+----java.awt.Component
|
+----java.awt.Container
|
+----java.awt.swing.JComponent
|
+----java.awt.swing.JProgressBar
- public class JProgressBar
- extends JComponent
- implements SwingConstants, Accessible
A control that displays an integer value within a bounded interval.
A progress bar typically communicates the progress of an event by
displaying its percentage of completion. The orientation of the
progress bar depends on its size; i.e. if its height is greater than
its width, it is vertical.
JProgressBar.ModelListener-
barModel-
changeEvent-
changeListener-
opaque-
orientation-
paintBorder-
JProgressBar()
- Creates a horizontal progress bar with a border.
addChangeListener(ChangeListener)
- Adds a ChangeListener to the button.
createChangeListener()
-
fireStateChanged()
-
getAccessibleRole()
- Get the role of this object.
getAccessibleStateSet()
- Get the state set of this object.
getAccessibleValue()
- Get the accessible value of this object.
getMaximum()
-
getMaximumAccessibleValue()
- Get the maximum accessible value of this object.
getMinimum()
-
getMinimumAccessibleValue()
- Get the minimum accessible value of this object.
getModel()
-
getOrientation()
- Returns JProgressBar.VERTICAL or JProgressBar.HORIZONTAL
depending on the orientation of the progress bar.
getUI()
-
getUIClassID()
-
getValue()
- Returns the value.
isBorderPainted()
- Returns true if the progress bar has a border or false if it does not.
isOpaque()
- Returns true if the progress bar is painting its background
or false if it does not.
paintBorder(Graphics)
- Paint the progress bar's border if BorderPainted property is true.
removeChangeListener(ChangeListener)
- Removes a ChangeListener from the button.
setAccessibleValue(Number)
- Set the value of this object as a Number.
setBorderPainted(boolean)
- Sets whether the progress bar should have a border.
setMaximum(int)
- Sets the maximum to x.
setMinimum(int)
- Sets the model's minimum to x.
setModel(BoundedRangeModel)
-
setOpaque(boolean)
- Sets whether the progress bar should paint its background.
setOrientation(int)
- Sets the progress bar's orientation to newOrientation, which
must be JProgressBar.VERTICAL or JProgressBar.HORIZONTAL.
setUI(ProgressBarUI)
-
setValue(int)
- Sets the value to x.
update(Graphics)
- Overridden to call paint without filling the background.
updateUI()
- Called to replace the UI with the latest version from the
default UIFactory.
orientation
protected int orientation
paintBorder
protected boolean paintBorder
opaque
protected boolean opaque
barModel
protected BoundedRangeModel barModel
changeEvent
protected transient ChangeEvent changeEvent
changeListener
protected ChangeListener changeListener
JProgressBar
public JProgressBar()
- Creates a horizontal progress bar with a border.
update
public void update(Graphics g)
- Overridden to call paint without filling the background.
- Overrides:
- update in class JComponent
getOrientation
public int getOrientation()
- Returns JProgressBar.VERTICAL or JProgressBar.HORIZONTAL
depending on the orientation of the progress bar. A progress bar's
default orientation is HORIZONTAL.
- Returns:
- HORIZONTAL or VERTICAL
setOrientation
public void setOrientation(int newOrientation)
- Sets the progress bar's orientation to newOrientation, which
must be JProgressBar.VERTICAL or JProgressBar.HORIZONTAL.
A progress bar's default orientation is HORIZONTAL.
- Parameters:
- newOrientation - HORIZONTAL or VERTICAL
- Throws:
IllegalArgumentException
- if newOrientation
is an illegal value
isBorderPainted
public boolean isBorderPainted()
- Returns true if the progress bar has a border or false if it does not.
- Returns:
- whether the progress bar has a border
- See Also:
- setBorderPainted
setBorderPainted
public void setBorderPainted(boolean b)
- Sets whether the progress bar should have a border.
- Parameters:
- b - true if the progress bar should have a border
- See Also:
- isBorderPainted
paintBorder
protected void paintBorder(Graphics g)
- Paint the progress bar's border if BorderPainted property is true.
- Overrides:
- paintBorder in class JComponent
- See Also:
- paint, setBorder
isOpaque
public boolean isOpaque()
- Returns true if the progress bar is painting its background
or false if it does not.
- Returns:
- whether the progress bar draws its background
- Overrides:
- isOpaque in class JComponent
- See Also:
- setOpaque
setOpaque
public void setOpaque(boolean opaque)
- Sets whether the progress bar should paint its background.
- Parameters:
- opaque - true if the progress bar should paint its background
- See Also:
- isOpaque
getUI
public ProgressBarUI getUI()
setUI
public void setUI(ProgressBarUI ui)
updateUI
public void updateUI()
- Called to replace the UI with the latest version from the
default UIFactory.
- Overrides:
- updateUI in class JComponent
getUIClassID
public String getUIClassID()
- Returns:
- "ProgressBarUI"
- Overrides:
- getUIClassID in class JComponent
- See Also:
- getUIClassID, getUI
createChangeListener
protected ChangeListener createChangeListener()
addChangeListener
public void addChangeListener(ChangeListener l)
- Adds a ChangeListener to the button.
removeChangeListener
public void removeChangeListener(ChangeListener l)
- Removes a ChangeListener from the button.
fireStateChanged
protected void fireStateChanged()
getModel
public BoundedRangeModel getModel()
setModel
public void setModel(BoundedRangeModel newModel)
getValue
public int getValue()
- Returns the value. The value is always between the
minimum and maximum, inclusive.
- Returns:
- the value
- See Also:
- setValue
getMinimum
public int getMinimum()
- Returns:
- the minimum
- See Also:
- setMinimum
getMaximum
public int getMaximum()
- Returns:
- the maximum
- See Also:
- setMaximum
setValue
public void setValue(int n)
- Sets the value to x. If x is less than the
minimum or greater than the maximum, this method throws
IllegalArgumentException and the value is not changed.
Notifies any listeners if the data changes.
- Parameters:
- x - the new value
- Throws:
IllegalArgumentException
- if x is outside
the legal range
- See Also:
- getValue
setMinimum
public void setMinimum(int n)
- Sets the model's minimum to x. If the current maximum or
value is outside of the new minimum, the maximum or value is
adjusted accordingly.
Notifies any listeners if the data changes.
- Parameters:
- x - the new minimum
- See Also:
- getMinimum, addChangeListener
setMaximum
public void setMaximum(int n)
- Sets the maximum to x. If the current minimum or value
is outside of the new maximum, the minimum or value is adjusted
accordingly.
Notifies any listeners if the data changes.
- Parameters:
- x - the new maximum
- See Also:
- getMaximum, addChangeListener
getAccessibleStateSet
public AccessibleStateSet getAccessibleStateSet()
- Get the state set of this object.
- Returns:
- an instance of AccessibleState containing the current state
of the object
- Overrides:
- getAccessibleStateSet in class JComponent
- See Also:
- AccessibleState
getAccessibleRole
public AccessibleRole getAccessibleRole()
- Get the role of this object.
- Returns:
- an instance of AccessibleRole describing the role of the object
- Overrides:
- getAccessibleRole in class JComponent
getAccessibleValue
public Number getAccessibleValue()
- Get the accessible value of this object.
- Returns:
- The current value of this object.
- Overrides:
- getAccessibleValue in class JComponent
setAccessibleValue
public boolean setAccessibleValue(Number n)
- Set the value of this object as a Number.
- Returns:
- True if the value was set.
- Overrides:
- setAccessibleValue in class JComponent
getMinimumAccessibleValue
public Number getMinimumAccessibleValue()
- Get the minimum accessible value of this object.
- Returns:
- The minimum value of this object.
- Overrides:
- getMinimumAccessibleValue in class JComponent
getMaximumAccessibleValue
public Number getMaximumAccessibleValue()
- Get the maximum accessible value of this object.
- Returns:
- The maximum value of this object.
- Overrides:
- getMaximumAccessibleValue in class JComponent
All Packages Class Hierarchy This Package Previous Next Index
Submit a bug or feature