-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBunkoMeterPage.java
More file actions
54 lines (45 loc) · 1.61 KB
/
BunkoMeterPage.java
File metadata and controls
54 lines (45 loc) · 1.61 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
import javax.swing.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
public class BunkoMeterPage {
private JTextField totalAttendence;
private JTextField presentClasses;
private JTextField absentClasses;
private JButton calculateAttendence;
private JPanel bunkoMeterPanel;
private JButton backButton;
private JFrame frame;
public BunkoMeterPage(JFrame frame) {
this.frame = frame;
initComponents();
calculateAttendence.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
// Add your logic to calculate attendance here
}
});
backButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
// Switch back to the main menu
frame.setContentPane(new mainMenu(frame).mainMenuPanel);
frame.revalidate(); // Refresh the frame
frame.pack(); // Adjust the frame size to fit the content
}
});
}
private void initComponents() {
// Initialize your components here if not generated by a GUI designer
}
public JPanel getBunkoMeterPanel() {
return bunkoMeterPanel;
}
// Main function
public static void main(String[] args) {
JFrame frame = new JFrame("BunkoMeter");
frame.setContentPane(new BunkoMeterPage(frame).bunkoMeterPanel);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.pack();
frame.setVisible(true);
}
}