-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathPageConThread.java
More file actions
41 lines (35 loc) · 792 Bytes
/
PageConThread.java
File metadata and controls
41 lines (35 loc) · 792 Bytes
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
import java.util.logging.Level;
import java.util.logging.Logger;
import java.net.*;
public class PageConThread extends Thread
{
Page page;
Boolean wait = false;
PageConThread( Page obj )
{
page = obj;
}
PageConThread( Page obj, Boolean w )
{
page = obj;
wait = true;
}
public void run()
{
if ( wait )
pause(100);
while( page.keepSitting() && !page.getStopForCleaner() )
{
page.changeSittingImage();
pause( 500 );
}
}
private void pause ( int time )
{
try {
Thread.sleep(time);
} catch (InterruptedException ex) {
Logger.getLogger(Movable.class.getName()).log(Level.SEVERE, null, ex);
}
}
}