This repository was archived by the owner on Mar 7, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCse360GUI.java
More file actions
82 lines (54 loc) · 2.19 KB
/
Cse360GUI.java
File metadata and controls
82 lines (54 loc) · 2.19 KB
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
import sun.jvm.hotspot.ui.JavaStackTracePanel;
import javax.swing.*;
import java.awt.*;
/**
* Created by CYH on 4/10/17.
*/
public class Cse360GUI {
public Cse360GUI() throws Exception {
JFrame mainFrame = mainFrame();
}
public JFrame mainFrame() {
JFrame mainFrame = new JFrame("The Devils' spell checker");
mainFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
JTextArea textArea = new JTextArea(20, 50);
textArea.setEditable(false);
mainFrame.add(textArea, BorderLayout.CENTER);
JLabel emptyLabel = new JLabel("");
emptyLabel.setPreferredSize(new Dimension(75, 100));
mainFrame.getContentPane().add(emptyLabel, BorderLayout.WEST);
JPanel bottomPanel = new JPanel();
bottomPanel.setLayout(new FlowLayout());
JButton runButton = new JButton("Run");
bottomPanel.add(runButton);
JButton helpButton = new JButton("Help");
bottomPanel.add(helpButton);
JButton quitButton = new JButton("Quit");
bottomPanel.add(quitButton);
mainFrame.add(bottomPanel, BorderLayout.SOUTH);
JPanel rightPanelAdd = new JPanel();
JButton addButton = new JButton("Add");
rightPanelAdd.add(addButton);
JPanel rightPanelIgnore = new JPanel();
JButton ignoreButton = new JButton("Ignore");
rightPanelIgnore.add(ignoreButton);
JPanel rightPanel = new JPanel();
rightPanel.setLayout(new BorderLayout());
rightPanel.add(rightPanelAdd, BorderLayout.NORTH);
rightPanel.add(rightPanelIgnore, BorderLayout.CENTER);
mainFrame.add(rightPanel, BorderLayout.EAST);
JPanel upPanel = new JPanel();
upPanel.setLayout(new FlowLayout());
JButton replaceButton = new JButton("Replace");
upPanel.add(replaceButton);
JButton statisticButton = new JButton("Statistic");
upPanel.add(statisticButton);
mainFrame.add(upPanel, BorderLayout.NORTH);
mainFrame.pack();
mainFrame.setVisible(true);
return mainFrame;
}
public static void main(String [] args) throws Exception {
Cse360GUI mainGUI = new Cse360GUI();
}
}