-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBeepPrintExample.java
More file actions
31 lines (29 loc) Β· 862 Bytes
/
BeepPrintExample.java
File metadata and controls
31 lines (29 loc) Β· 862 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
package ch14.sec03.exam03;
import java.awt.*;
public class BeepPrintExample {
public static void main(String[] args) {
// μ리μ μΆλ ₯ λμ μ€ν
Thread thread = new Thread() {
@Override
public void run() {
// μμ
Thread μ€ν (thread.start())
Toolkit toolkit = Toolkit.getDefaultToolkit();
for (int i = 0; i < 5; i++) {
toolkit.beep();
try {
Thread.sleep(500);
} catch (Exception e) {
}
}
}
};
thread.start();
for (int i = 0; i < 5; i++) {
System.out.println("λ΅");
try {
Thread.sleep(500);
} catch (Exception e) {
}
}
}
}