-
Notifications
You must be signed in to change notification settings - Fork 1
/
Month.java
66 lines (44 loc) · 1.58 KB
/
Month.java
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
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import java.util.ArrayList;
public class Month extends JFrame implements ActionListener {
JButton profiles;
JButton back;
public Month() {
super("View All Month Profiles");
this.setSize(600, 600);
this.setForeground(Color.BLACK);
this.setVisible(true);
this.setLayout(new GridLayout(2, 1));
profiles = new JButton("Profiles");
back = new JButton("Back");
this.add(profiles);
this.add(back);
profiles.addActionListener(this);
back.addActionListener(this);
}
@Override
public void actionPerformed(ActionEvent e) {
if (e.getSource() == profiles) {
AdminOperations ao = new AdminOperations();
ArrayList <Customer> s = ao.viewAllProfiles();
if (s.size() == 0) {
JOptionPane.showMessageDialog(null, "No Data Found");
}
if (s.size() >= 1) {
for (int i = 0; i < s.size(); i++) {
int month=Integer.parseInt(s.get(i).getDayForRent());
if(month >=30){
String details = s.get(i).toString();
JOptionPane.showMessageDialog(null ,details);
}
}
}
}
if (e.getSource() == back) {
this.dispose();
new Admin();
}
}
}