-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMain.java
44 lines (36 loc) · 1.23 KB
/
Main.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
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Font;
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import javax.swing.JFrame;
import javax.swing.JScrollPane;
import javax.swing.JTextArea;
public class Main {
public static void main(String[] args) {
StringBuilder sb = new StringBuilder();
try (BufferedReader br = new BufferedReader(new FileReader("/Users/TamerAltaji/Desktop/Java-Workplace/DataStructureProject/src/output"))) {
String line;
while ((line = br.readLine()) != null) {
sb.append(line);
sb.append(System.lineSeparator());
}
} catch (IOException e) {
e.printStackTrace();
}
Font font = new Font("Segoe Script", Font.BOLD | Font.ITALIC, 20);
JFrame frame = new JFrame();
frame.setSize(800,800);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
JTextArea textArea = new JTextArea(sb.toString());
textArea.setFont(font);
textArea.setForeground(Color.WHITE);
textArea.setBackground(Color.BLUE);
frame.add(textArea);
JScrollPane scrollPane = new JScrollPane(textArea);
frame.add(scrollPane);
frame.setLocationRelativeTo(null);
frame.setVisible(true);
}
}