imports leaned
[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 public class AdminMenuGUI extends JFrame {
15
16         /**
17          * 
18          */
19         private static final long serialVersionUID = 1L;
20         private JPanel contentPane;
21
22
23         public static void main(String[] args){
24                 Frame a = new AdminMenuGUI();
25                 a.setVisible(true);
26         }
27         /**
28          * Create the frame.
29          */
30         public AdminMenuGUI() {
31                 
32                 
33                 
34                 this.setTitle("Owner Menu");
35                 this.getContentPane().setLayout(null);
36                 setBounds(100, 100, 450, 473);
37                 contentPane = new JPanel();
38                 contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
39                 setContentPane(contentPane);
40                 //TODO BOTH BUTTONS ARE TO MODIFY
41                 JButton btnAdd = new JButton("Add Requests");
42                 btnAdd.addActionListener(new ActionListener() {
43                         public void actionPerformed(ActionEvent e) {
44                                 Frame a = new listOfAdditionRequestsGUI();
45                                 a.setVisible(true);
46                         }
47                 });
48                 
49                 JButton btnDel = new JButton("Delete Requests");
50                 btnDel.addActionListener(new ActionListener() {
51                         public void actionPerformed(ActionEvent e) {
52                                 Frame a = new listOfRemovalRequestsGUI();
53                                 a.setVisible(true);
54                         }
55                 });
56                 GroupLayout gl_contentPane = new GroupLayout(contentPane);
57                 gl_contentPane.setHorizontalGroup(
58                         gl_contentPane.createParallelGroup(Alignment.LEADING)
59                                 .addGroup(gl_contentPane.createSequentialGroup()
60                                         .addGap(115)
61                                         .addGroup(gl_contentPane.createParallelGroup(Alignment.LEADING)
62                                                 .addComponent(btnDel, GroupLayout.PREFERRED_SIZE, 164, GroupLayout.PREFERRED_SIZE)
63                                                 .addComponent(btnAdd, GroupLayout.PREFERRED_SIZE, 164, GroupLayout.PREFERRED_SIZE))
64                                         .addContainerGap(145, Short.MAX_VALUE))
65                 );
66                 gl_contentPane.setVerticalGroup(
67                         gl_contentPane.createParallelGroup(Alignment.LEADING)
68                                 .addGroup(gl_contentPane.createSequentialGroup()
69                                         .addGap(62)
70                                         .addComponent(btnAdd, GroupLayout.PREFERRED_SIZE, 81, GroupLayout.PREFERRED_SIZE)
71                                         .addGap(58)
72                                         .addComponent(btnDel, GroupLayout.PREFERRED_SIZE, 81, GroupLayout.PREFERRED_SIZE)
73                                         .addContainerGap(142, Short.MAX_VALUE))
74                 );
75                 contentPane.setLayout(gl_contentPane);
76         }
77
78 }