-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRotate.java
More file actions
44 lines (36 loc) · 927 Bytes
/
Copy pathRotate.java
File metadata and controls
44 lines (36 loc) · 927 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
42
43
44
import java.awt.*;
import java.applet.Applet;
import java.awt.event.*;
public class Rotate extends Applet implements Runnable
{
Font titleFont = new Font("bold", 1, 36);
Thread main = new Thread(this);
String output = "Welcome";
public void init()
{
this.resize(1300, 756);
main.start();
}
public String shiftLeft(String word)
{
return word.substring(1) + word.substring(0, 1);
}
public void paint(Graphics g)
{
g.setColor(Color.blue);
g.setFont(titleFont);
g.drawString(output, 230, 300);
}
public void run()
{
while(true)
{
repaint();
try {
main.sleep(500);
} catch(Exception e) {
}
output = shiftLeft(output);
}
}
}