The Java Program: Main.java
1
2
3
4
5
6
7
8 import javax.swing.JPanel;
9
10 class Main {
11 public static void main(String[] args) {
12
13 System.out.println (new JPanel().isDisplayable());
14 final Thread t = Thread.currentThread();
15 final int active = t.activeCount();
16 System.out.println("currently active threads: " + active);
17 final Thread all[] = new Thread[active];
18 t.enumerate(all);
19 for (int i = 0; i < active; i++) {
20 System.out.println(i + ": " + all[i]);
21 }
22
23
24
25
26
27
28
29
30
31 }
32 }