Booking confirmation and e-mail service added. Some bugs to be solved.
[RRRRHHHH_Code] / ruralHouses / src / gui / AdminMenuGUI.java
1 package gui;
2
3 import java.awt.Frame;
4 import java.awt.event.ActionEvent;
5 import java.awt.event.ActionListener;
6
7 import javax.swing.GroupLayout;
8 import javax.swing.GroupLayout.Alignment;
9 import javax.swing.JButton;
10 import javax.swing.JFrame;
11 import javax.swing.JPanel;
12 import javax.swing.border.EmptyBorder;
13
14 import domain.Administrator;
15
16 public class AdminMenuGUI extends JFrame {
17
18         /**
19          * 
20          */
21         private static final long serialVersionUID = 1L;
22         private JPanel contentPane;
23
24
25         
26         /**
27          * Create the frame.
28          */
29         public AdminMenuGUI() {
30                 
31                 
32                 Administrator.getInstance();
33                 this.setTitle("Administrator Menu");
34                 this.getContentPane().setLayout(null);
35                 setBounds(100, 100, 450, 473);
36                 contentPane = new JPanel();
37                 contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
38                 setContentPane(contentPane);
39                 //TODO BOTH BUTTONS ARE TO MODIFY
40                 JButton btnAdd = new JButton("Add requests");
41                 btnAdd.addActionListener(new ActionListener() {
42                         public void actionPerformed(ActionEvent e) {
43                                 Frame a = new listOfAdditionRequestsGUI();
44                                 a.setVisible(true);
45                         }
46                 });
47                 
48                 JButton btnDel = new JButton("Delete Requests");
49                 btnDel.addActionListener(new ActionListener() {
50                         public void actionPerformed(ActionEvent e) {
51                                 Frame a = new listOfRemovalRequestsGUI();
52                                 a.setVisible(true);
53                         }
54                 });
55                 
56                 JButton btnOwneraddition = new JButton("OwnerAddition");
57                 btnOwneraddition.addActionListener(new ActionListener() {
58                         public void actionPerformed(ActionEvent e) {
59                                 Frame a = new ownerAddittionRequests();
60                                 a.setVisible(true);
61                         }
62                 });
63                 GroupLayout gl_contentPane = new GroupLayout(contentPane);
64                 gl_contentPane.setHorizontalGroup(
65                         gl_contentPane.createParallelGroup(Alignment.LEADING)
66                                 .addGroup(gl_contentPane.createSequentialGroup()
67                                         .addGap(115)
68                                         .addGroup(gl_contentPane.createParallelGroup(Alignment.TRAILING, false)
69                                                 .addComponent(btnOwneraddition, Alignment.LEADING, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
70                                                 .addComponent(btnDel, Alignment.LEADING, GroupLayout.DEFAULT_SIZE, 164, Short.MAX_VALUE)
71                                                 .addComponent(btnAdd, Alignment.LEADING, GroupLayout.DEFAULT_SIZE, 164, Short.MAX_VALUE))
72                                         .addContainerGap(145, Short.MAX_VALUE))
73                 );
74                 gl_contentPane.setVerticalGroup(
75                         gl_contentPane.createParallelGroup(Alignment.LEADING)
76                                 .addGroup(gl_contentPane.createSequentialGroup()
77                                         .addGap(62)
78                                         .addComponent(btnAdd, GroupLayout.PREFERRED_SIZE, 81, GroupLayout.PREFERRED_SIZE)
79                                         .addGap(58)
80                                         .addComponent(btnDel, GroupLayout.PREFERRED_SIZE, 81, GroupLayout.PREFERRED_SIZE)
81                                         .addGap(52)
82                                         .addComponent(btnOwneraddition, GroupLayout.DEFAULT_SIZE, 79, Short.MAX_VALUE)
83                                         .addContainerGap())
84                 );
85                 contentPane.setLayout(gl_contentPane);
86         }
87 }