-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMainFrame.java
More file actions
42 lines (38 loc) · 1.3 KB
/
Copy pathMainFrame.java
File metadata and controls
42 lines (38 loc) · 1.3 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
package GUI;
import Guitil.GUItil;
import javax.swing.*;
import java.awt.*;
public class MainFrame extends JFrame {
private TopoForm topoForm;
private DataBox dataBox;
private NotificationForm notificationForm;
private ControlPanel controlPanel;
public MainFrame() {
this.setLayout(new BorderLayout(3,3));
}
public void load() {
topoForm = new TopoForm();
dataBox = new DataBox();
//加载JTree
dataBox.load();
notificationForm = new NotificationForm();
controlPanel = new ControlPanel();
JPanel panel1 = topoForm.getJpanel();
JPanel panel2 = dataBox.getPanel();
JPanel panel3 = notificationForm.getPanel1();
JPanel panel4 = controlPanel.getPanel();
this.add(panel1,BorderLayout.CENTER);
this.add(panel2,BorderLayout.WEST);
this.add(panel3,BorderLayout.NORTH);
this.add(panel4,BorderLayout.EAST);
Rectangle bounds = GUItil.getBounds();
this.setBounds(bounds);
this.setExtendedState(JFrame.MAXIMIZED_BOTH);
this.setLocationRelativeTo(null);
this.setDefaultCloseOperation(EXIT_ON_CLOSE);
//窗体可拉伸
this.setTitle("羊群系统自组网仿真系统");
this.setResizable(true);
this.setVisible(true);
}
}