Progress Bar and Scroller reusable components
The two components I've developed are small in size (light weight), and simple to use. The ProgressBar is written without platform-native code (peerless), while the Scroller combines AWT components by "wrapping" a horizontal and vertical Scrollbar around a Canvas.
Here's a
demo applet using both components.
How to use
the ProgressBar component:
-
Download the ProgressBar
class file and put it in the same directory as the applet class files.
-
Use one of the layout
managers like boarderlayout to position it in the applet.
-
When your applet needs
to update the progress bar, just call the updateBar method.
How
to use the Scroller component:
-
Download the Scroller
and ScrollReadable class files and put them in the same directory as the
applet class files.
-
Subclass a Canvas component
and implement the ScrollReadable interface.
-
Create an array of type
ScrollReadable and insert a reference to the Canvas.
-
Instantiate the Scroller
object passing it a reference to the array of type ScrollReadable, it will
return a Panel.
-
Use one of the layout
managers like boarderlayout to position the Panel in the applet.
-
Whenever a scrollbar
is scrolled, the Scroller object will pass to all objects in the ScrollReadable
array the state of the scroll bars.
Java source
for the ProgressBar, Scroller, and the Demo Applet:
Documentation
for the ProgressBar, Scroller, and the Demo Applet:
The Progress
bar and Scroller class files (to save, right click and use the 'save link
as' option):
Both components are JARS rated, and can be found at these sites:
Number of hits:
Email
me at: l_schiano
@hotmail.com