All Packages Class Hierarchy This Package Previous Next Index
Class com.sun.wizards.awt.ProgressBar
java.lang.Object
|
+----java.awt.Component
|
+----com.sun.wizards.awt.ProgressBar
- public class ProgressBar
- extends Component
ProgressBar is a Component that indicates percentage completion of a
process that has a lengthy execution time.
The ProgressBar object itself does not calculate the percentage
complete. The progress must be set periodically using the setProgress
method.
Here is the code for this applet:
import java.applet.Applet;
import java.awt.*;
import com.sun.wizards.awt.*;
public class Test extends Applet
{
public void init()
{
setLayout(new GridBagLayout());
ProgressBar progressBar = new ProgressBar();
progressBar.setProgress(75);
add(progressBar);
}
}
-
depth
- The depth is the variable that gives the illusion
that the progress bar stands above its owner
panel.
-
progress
- The current progress.
-
size
- The preferred size of this progress bar.
-
ProgressBar()
- Creates a progress bar.
-
drawProgress(Graphics, int, int)
- Draw the progress within the progress bar with the specified
Graphics.
-
drawProgressBorder(Graphics)
- Draw the progress bar border.
-
getDepth()
- Returns the current depth of the progress bar.
-
getMinimumSize()
- Returns the minimum size of this progress bar.
-
getPreferredSize()
- Returns the preferred size of this progress bar.
-
getProgress()
- Returns the current progress being displayed by
this progress bar.
-
paint(Graphics)
- Paints the entire progress bar.
-
setDepth(int)
- Set the depth of the progress bar border.
-
setProgress(int)
- Set the progress that this progress bar should display.
-
setSize(Dimension)
- Sets the size of this progress bar.
size
protected Dimension size
- The preferred size of this progress bar.
progress
protected int progress
- The current progress.
depth
protected int depth
- The depth is the variable that gives the illusion
that the progress bar stands above its owner
panel.
ProgressBar
public ProgressBar()
- Creates a progress bar.
setSize
public void setSize(Dimension newSize)
- Sets the size of this progress bar.
- Parameters:
- newSize - The new size for this progress bar.
- Overrides:
- setSize in class Component
setDepth
public void setDepth(int depth)
- Set the depth of the progress bar border. The larger
the depth value is, the higher the progress bar appears
to stand above the panel.
- Parameters:
- depth - The new depth.
getDepth
public int getDepth()
- Returns the current depth of the progress bar.
- Returns:
- The current depth.
getPreferredSize
public Dimension getPreferredSize()
- Returns the preferred size of this progress bar.
- Returns:
- The preferred size.
- Overrides:
- getPreferredSize in class Component
getMinimumSize
public Dimension getMinimumSize()
- Returns the minimum size of this progress bar.
- Returns:
- The minimum size.
- Overrides:
- getMinimumSize in class Component
setProgress
public void setProgress(int progress)
- Set the progress that this progress bar should display.
- Parameters:
- progress - The new progress.
getProgress
public int getProgress()
- Returns the current progress being displayed by
this progress bar.
- Returns:
- The current progress.
paint
public void paint(Graphics g)
- Paints the entire progress bar. For progress
updates,
drawProgress should be used
because it does not repaint the borders.
- Parameters:
- g - The Graphics window.
- Overrides:
- paint in class Component
drawProgress
protected void drawProgress(Graphics g,
int previousProgress,
int currentProgress)
- Draw the progress within the progress bar with the specified
Graphics. Only the difference between the previous progress
and the current progress will be drawn.
- Parameters:
- g - The Graphics to use when drawing the progress.
- previousProgress - The previous progress value.
- currentProgress - The current progress value.
drawProgressBorder
protected void drawProgressBorder(Graphics g)
- Draw the progress bar border.
- Parameters:
- g - The Graphics to use when drawing the progress barr border.
All Packages Class Hierarchy This Package Previous Next Index