|
Java Platform 1.2 Beta 4 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.awt.Component | +--java.awt.Container | +--com.sun.java.swing.JComponent | +--com.sun.java.swing.JProgressBar
Warning: serialized objects of this class will not be compatible with future swing releases. The current serialization support is appropriate for short term storage or RMI between Swing1.0 applications. It will not be possible to load serialized Swing1.0 objects with future releases of Swing. The JDK1.2 release of Swing will be the compatibility baseline for the serialized form of Swing objects.
Inner Class Summary | |
protected | JProgressBar.AccessibleJProgressBar
The class used to obtain the accessible role for this object. |
Inner classes inherited from class com.sun.java.swing.JComponent | |
JComponent.AccessibleJComponent |
Field Summary | |
protected ChangeEvent | changeEvent
Only one ChangeEvent is needed per instance since the event's only interesting property is the immutable source, which is the progress bar. |
protected ChangeListener | changeListener
|
protected BoundedRangeModel | model
|
protected int | orientation
|
protected boolean | paintBorder
|
protected boolean | paintString
|
protected String | progressString
|
Fields inherited from class com.sun.java.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.Component | |
BOTTOM_ALIGNMENT , CENTER_ALIGNMENT , LEFT_ALIGNMENT , RIGHT_ALIGNMENT , TOP_ALIGNMENT |
Constructor Summary | |
JProgressBar()
Creates a horizontal progress bar. |
|
JProgressBar(BoundedRangeModel newModel)
Creates a horizontal progress bar. |
|
JProgressBar(int orient,
int min,
int max)
Creates a progress bar using the specified orientation, minimum, and maximum. |
|
JProgressBar(int min,
int max)
Creates a horizontal progress bar using the specified minimum and maximum. |
|
JProgressBar(int orient)
Creates a progress bar with the specified orientation, which can be either HORIZONTAL or VERTICAL. Uses the defaultMinimum and defaultMaximum. |
Method Summary | |
void | addChangeListener(ChangeListener l)
Adds a ChangeListener to the button. |
protected ChangeListener | createChangeListener()
|
protected void | fireStateChanged()
Notify all listeners that have registered interest for notification on this event type. |
AccessibleContext | getAccessibleContext()
Get the AccessibleContext associated with this JComponent |
int | getMaximum()
Returns the model's maximum value. |
int | getMinimum()
Returns the model's minimum value. |
BoundedRangeModel | getModel()
Returns the data model used by the JProgressBar. |
int | getOrientation()
Returns JProgressBar. |
double | getPercentComplete()
Returns the percentage/percent complete for the progress bar. |
String | getString()
Returns the current value of the Progress String. |
ProgressBarUI | getUI()
Returns the L&F object that renders this component. |
String | getUIClassID()
Returns the name of the L&F class that renders this component. |
int | getValue()
Returns the model's current value. |
boolean | isBorderPainted()
Returns true if the progress bar has a border or false if it does not. |
boolean | isStringPainted()
Returns true if the progress bar will render a string onto the representation of the progress bar. |
protected void | paintBorder(Graphics g)
Paint the progress bar's border if BorderPainted property is true. |
void | removeChangeListener(ChangeListener l)
Removes a ChangeListener from the button. |
void | setBorderPainted(boolean b)
Sets whether the progress bar should have a border. |
void | setMaximum(int n)
Sets the model's maximum to x. |
void | setMinimum(int n)
Sets the model's minimum to x. |
void | setModel(BoundedRangeModel newModel)
Sets the data model used by the JProgressBar. |
void | setOrientation(int newOrientation)
Sets the progress bar's orientation to newOrientation, which must be JProgressBar. |
void | setString(String s)
Sets the value of the Progress String. |
void | setStringPainted(boolean b)
Sets whether the progress bar will render a percent string. |
void | setUI(ProgressBarUI ui)
Sets the L&F object that renders this component. |
void | setValue(int n)
Sets the model's current value to x. |
void | updateUI()
Notification from the UIFactory that the L&F has changed. |
Methods inherited from class java.awt.Container | |
add , add , add , add , add , addContainerListener , addImpl , countComponents , deliverEvent , doLayout , findComponentAt , findComponentAt , getComponent , getComponentAt , getComponentAt , getComponentCount , getComponents , getLayout , insets , invalidate , isAncestorOf , layout , list , list , locate , minimumSize , paintComponents , paramString , preferredSize , print , printComponents , processContainerEvent , processEvent , remove , remove , removeAll , removeContainerListener , setLayout , validate , validateTree |
Methods inherited from class java.lang.Object | |
clone , equals , finalize , getClass , hashCode , notify , notifyAll , wait , wait , wait |
Field Detail |
protected int orientation
protected boolean paintBorder
protected BoundedRangeModel model
protected String progressString
protected boolean paintString
protected transient ChangeEvent changeEvent
protected ChangeListener changeListener
Constructor Detail |
public JProgressBar()
public JProgressBar(int orient)
public JProgressBar(int min, int max)
public JProgressBar(int orient, int min, int max)
public JProgressBar(BoundedRangeModel newModel)
Method Detail |
public int getOrientation()
JProgressBar.VERTICAL
or
JProgressBar.HORIZONTAL
, depending on the orientation
of the progress bar. The default orientation is
HORIZONTAL
.public void setOrientation(int newOrientation)
JProgressBar.VERTICAL
or
JProgressBar.HORIZONTAL
. The default orientation
is HORIZONTAL
.
newOrientation
- HORIZONTAL or VERTICALpublic boolean isStringPainted()
setStringPainted
public void setStringPainted(boolean b)
b
- true if the progress bar will render a percent string.isStringPainted
public String getString()
setString
public void setString(String s)
s
- the value of the percent stringgetString
public double getPercentComplete()
public boolean isBorderPainted()
setBorderPainted
public void setBorderPainted(boolean b)
b
- true if the progress bar should have a borderisBorderPainted
protected void paintBorder(Graphics g)
g
- the Graphics context within which to paint the borderJComponent.paint(java.awt.Graphics)
,
JComponent.setBorder(com.sun.java.swing.border.Border)
public ProgressBarUI getUI()
public void setUI(ProgressBarUI ui)
ui
- the ProgressBarUI L&F objectUIDefaults.getUI(com.sun.java.swing.JComponent)
public void updateUI()
JComponent.updateUI()
public String getUIClassID()
JComponent.getUIClassID()
,
UIDefaults.getUI(com.sun.java.swing.JComponent)
protected ChangeListener createChangeListener()
public void addChangeListener(ChangeListener l)
l
- the ChangeListener to addpublic void removeChangeListener(ChangeListener l)
l
- the ChangeListener to removeprotected void fireStateChanged()
EventListenerList
public BoundedRangeModel getModel()
BoundedRangeModel
public void setModel(BoundedRangeModel newModel)
newModel
- the BoundedRangeModel to useBoundedRangeModel
public int getValue()
setValue(int)
,
BoundedRangeModel
public int getMinimum()
setMinimum(int)
,
BoundedRangeModel
public int getMaximum()
setMaximum(int)
,
BoundedRangeModel
public void setValue(int n)
IllegalArgumentException
and the value is not changed.
Notifies any listeners if the data changes.
x
- the new valuegetValue()
,
BoundedRangeModel
public void setMinimum(int n)
Notifies any listeners if the data changes.
x
- the new minimumgetMinimum()
,
addChangeListener(com.sun.java.swing.event.ChangeListener)
,
BoundedRangeModel
public void setMaximum(int n)
Notifies any listeners if the data changes.
x
- the new maximumgetMaximum()
,
addChangeListener(com.sun.java.swing.event.ChangeListener)
,
BoundedRangeModel
public AccessibleContext getAccessibleContext()
|
Java Platform 1.2 Beta 4 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |