KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > ixenon > free > swing > UpdateProgressBar


1 /* $Id$
2  *
3  * Copyright (c) 1998 Xenonsoft Limited. All Rights Reserved.
4  *
5  * This software is protected by copyright. You are hereby notified from
6  * now by reading this message. This software is also the confidential
7  * and proprietary information of Xenonsoft Limited. ("Confidential
8  * Information").
9  *
10  * This software is distributed under the Xenonsoft Public end user
11  * License ("XPeL"), where the machine-readable source code is provided
12  * under the "Open Source" model.
13  * For more information, please read the file "LICENSE-XPL.txt"
14  */

15
16 //
17
// DESCRIPTION
18
//
19
// Peter Pilgrim
20
// Sun Jan 24 12:05:39 GMT 1999
21
//
22
// RCS HEADER
23
//
24
// $Author$
25
// $Date$
26
// $Source$
27
// $Revision$ $State$ $Locker$
28
//
29

30 package ixenon.free.swing;
31
32 import java.awt.*;
33 import java.awt.event.*;
34
35 import javax.swing.*; // For JTree
36
import javax.swing.event.*; // For events
37

38 /** Private class to update the progress bar from the `installable' thread
39  * Update the progress bar thread safe with Swing!
40  *
41  * Better safe than sorry *PP* Sun Jan 24 18:45:20 GMT 1999
42  * @author Peter Pilgrim
43  * @version $Id$
44  */

45
46 public class UpdateProgressBar implements Runnable JavaDoc {
47     private JProgressBar pbar;
48     private int value;
49     
50     /** construct a utility to class to update a JProgressBar from
51      * another thread which happens to be <B>NOT</B> the System Event
52      * Queue.
53      * @param pbar the progress bar component
54      * @param value the present value
55      */

56     public UpdateProgressBar( JProgressBar pbar, int value )
57     {
58     this.pbar = pbar;
59     this.value = value;
60     }
61
62     public void run()
63     {
64     pbar.setValue(value);
65     }
66 }
67
68 // fini
69
Popular Tags