-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMainDashboard.java
More file actions
41 lines (34 loc) · 1.43 KB
/
Copy pathMainDashboard.java
File metadata and controls
41 lines (34 loc) · 1.43 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
import java.awt.*;
import java.awt.event.*;
public class MainDashboard {
public static void main(String[] args) {
Frame frame = new Frame("Student Management System");
frame.setSize(400, 300);
frame.setLayout(null);
// Close the window on clicking the close button
frame.addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent e) {
frame.dispose();
System.exit(0);
}
});
Button insertButton = new Button("Insert Student");
Button updateButton = new Button("Update Student");
Button deleteButton = new Button("Delete Student");
Button viewButton = new Button("View Students");
insertButton.setBounds(100, 30, 200, 40);
updateButton.setBounds(100, 80, 200, 40);
deleteButton.setBounds(100, 130, 200, 40);
viewButton.setBounds(100, 180, 200, 40);
frame.add(insertButton);
frame.add(updateButton);
frame.add(deleteButton);
frame.add(viewButton);
frame.setVisible(true);
// Hook all buttons to their respective GUI classes
insertButton.addActionListener(e -> StudentInsertGUI.main(null));
updateButton.addActionListener(e -> StudentUpdateGUI.main(null));
deleteButton.addActionListener(e -> StudentDeleteGUI.main(null));
viewButton.addActionListener(e -> StudentViewGUI.main(null));
}
}