-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdashboard.java
More file actions
48 lines (39 loc) · 1.03 KB
/
Copy pathdashboard.java
File metadata and controls
48 lines (39 loc) · 1.03 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
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
class dashboard extends JFrame{
Container c;
JButton btnAdd,btnView;
dashboard(){
c = getContentPane();
c.setLayout(null);
btnAdd = new JButton("Add Student");
btnView = new JButton("View Student");
Font f = new Font("Times New Roman",Font.BOLD,25);
btnAdd.setFont(f);
btnView.setFont(f);
btnAdd.setBounds(110, 80, 270, 40);
btnView.setBounds(110, 200, 270, 40);
c.add(btnAdd);
c.add(btnView);
class Eh1 implements ActionListener{
public void actionPerformed(ActionEvent ae){
add a = new add();
dispose();
}
}
btnAdd.addActionListener(new Eh1());
class Eh2 implements ActionListener{
public void actionPerformed(ActionEvent ae){
view a = new view();
dispose();
}
}
btnView.addActionListener(new Eh2());
setSize(500,400);
setLocationRelativeTo(null);
setTitle("Main Window");
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setVisible(true);
}
}