-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTimeMeter.java
48 lines (48 loc) · 1022 Bytes
/
TimeMeter.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
import javax.swing.*;
import java.awt.*;
public class TimeMeter
{
public void addBar()
{
Va.timer=new JProgressBar(0,100);
Va.timer.setValue(0);
Va.timer.setFont(new Font("arial",1,15));
Va.timer.setForeground(Color.yellow);
Va.timer.setStringPainted(true);
}
public void iterate()
{
Va.spa.setVisible(false);
Va.mp.setVisible(true);
new MarqueeThread().start();
Va.timerstarted=true;
Va.timer.setVisible(true);
new BarThread().start();
}
class BarThread extends Thread
{
public void run()
{
int i=0;
int c=Va.bs[Va.speedi];
System.out.println(c);
while(i<=100)
{
if(!Va.bonusfoodvisible)
break;
Va.timer.setValue(++i);
Ex.exp1(c);
}
Va.spa.setVisible(true);
Va.mp.setVisible(false);
Va.foodeated=true;
Va.timer.setVisible(false);
Va.timerstarted=false;
if(i>100)
{
Va.bonusfood.setVisible(false);
Va.bonusfoodvisible=false;
}
}
}
}