KickJava   Java API By Example, From Geeks To Geeks.

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


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  * Blimey guv this is a lot of work to get around the multithreaded Swing
40  * controversy. But hell, I don't want the `FreeInstaller' to crash one day
41  * when somebody tries to install a program, and MT code is much harder to
42  * debug.
43  *
44  * Better safe than sorry *PP* Sun Jan 24 18:45:20 GMT 1999
45  * @author Peter Pilgrim
46  * @version $Id$
47  */

48 public class ResetProgressBar implements Runnable JavaDoc {
49     private JProgressBar pbar;
50     private int min, max, value;
51
52     /** construct a utility to class to set up a JProgressBar from
53      * another thread which happens to be <B>NOT</B> the System Event
54      * Queue.
55      * @param pbar the progress bar component
56      * @param min the minimum value
57      * @param max the maximum value
58      * @param value the present value
59      */

60     public ResetProgressBar( JProgressBar pbar, int min, int max, int value )
61     {
62     this.pbar = pbar;
63     this.min = min;
64     this.max = max;
65     this.value = value;
66     }
67
68     public void run()
69     {
70     pbar.setMinimum(min);
71     pbar.setMaximum(max);
72     pbar.setValue(value);
73     }
74 }
75     
76
77 // fini
78
Popular Tags