All Packages Class Hierarchy This Package Previous Next Index
Class com.sun.java.swing.JProgressBar
java.lang.Object
|
+----java.awt.Component
|
+----java.awt.Container
|
+----com.sun.java.swing.JComponent
|
+----com.sun.java.swing.JProgressBar
- public class JProgressBar
- extends JComponent
- implements SwingConstants
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.
-
barModel
-
-
changeEvent
-
-
changeListener
-
-
changeListenerList
-
-
orientation
-
-
paintBackground
-
-
paintBorder
-
-
JProgressBar()
- Creates a horizontal progress bar with a border.
-
addChangeListener(ChangeListener)
-
-
createChangeListener()
-
-
getMaximum()
-
-
getMinimum()
-
-
getModel()
-
-
getOrientation()
- Returns JProgressBar.VERTICAL or JProgressBar.HORIZONTAL
depending on the orientation of the progress bar.
-
getUI()
-
-
getValue()
- Returns the value.
-
isBackgroundPainted()
- Returns true if the progress bar is painting its background or false if it does not.
-
isBorderPainted()
- Returns true if the progress bar has a border or false if it does not.
-
isOpaque()
-
-
removeChangeListener(ChangeListener)
-
-
setBackgroundPainted(boolean)
- Sets whether the progress bar should paint its background.
-
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)
-
-
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
paintBackground
protected boolean paintBackground
barModel
protected BoundedRangeModel barModel
changeListenerList
protected ChangeListener changeListenerList
changeListener
protected ChangeListener changeListener
changeEvent
protected final ChangeEvent changeEvent
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 Container
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
isBackgroundPainted
public boolean isBackgroundPainted()
- Returns true if the progress bar is painting its background or false if it does not.
- Returns:
- whether the progress bar draws its background
- See Also:
- setBackgroundPainted
isOpaque
public boolean isOpaque()
- Overrides:
- isOpaque in class JComponent
setBackgroundPainted
public void setBackgroundPainted(boolean b)
- Sets whether the progress bar should paint its background.
- Parameters:
- b - true if the progress bar should paint its background
- See Also:
- isBackgroundPainted
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
createChangeListener
protected ChangeListener createChangeListener()
addChangeListener
public void addChangeListener(ChangeListener l)
removeChangeListener
public void removeChangeListener(ChangeListener l)
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
All Packages Class Hierarchy This Package Previous Next Index