Username is saved hashed and password hashed and salted
[RRRRHHHH_Code] / ruralHouses / src / gui / OwnerMenuGUI.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.Owner;
15 import javax.swing.LayoutStyle.ComponentPlacement;
16
17 public class OwnerMenuGUI extends JFrame {
18
19         /**
20          * 
21          */
22         private static final long serialVersionUID = 1L;
23         private JPanel contentPane;
24         private Owner owner;
25
26
27         /**
28          * Create the frame.
29          */
30         public OwnerMenuGUI(Owner o) {
31                 this.setTitle("Owner Menu");
32                 this.getContentPane().setLayout(null);
33                 owner = o;
34                 setBounds(100, 100, 450, 473);
35                 contentPane = new JPanel();
36                 contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
37                 setContentPane(contentPane);
38                 
39                 JButton btnHouses = new JButton("Houses");
40                 btnHouses.addActionListener(new ActionListener() {
41                         public void actionPerformed(ActionEvent e) {
42                                 Frame a = new HousesRelatedOwnerGUI(owner);
43                                 a.setVisible(true);
44                         }
45                 });
46
47                 JButton btnOffers = new JButton("Offers");
48                 btnOffers.addActionListener(new ActionListener() {
49                         public void actionPerformed(ActionEvent e) {
50                                 Frame a = new OffersRelatedOwnerGUI(owner);
51                                 a.setVisible(true);
52                         }
53                 });
54                 
55                 JButton btnBookings = new JButton("Bookings");
56                 btnBookings.addActionListener(new ActionListener() {
57                         public void actionPerformed(ActionEvent e) {
58                                 Frame a = new listOfBookingRequestsGUI(owner);
59                                 a.setVisible(true);
60                         }
61                 });
62                 GroupLayout gl_contentPane = new GroupLayout(contentPane);
63                 gl_contentPane.setHorizontalGroup(
64                         gl_contentPane.createParallelGroup(Alignment.LEADING)
65                                 .addGroup(gl_contentPane.createSequentialGroup()
66                                         .addGap(115)
67                                         .addGroup(gl_contentPane.createParallelGroup(Alignment.LEADING, false)
68                                                 .addComponent(btnBookings, Alignment.TRAILING, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
69                                                 .addComponent(btnOffers, Alignment.TRAILING, GroupLayout.DEFAULT_SIZE, 164, Short.MAX_VALUE)
70                                                 .addComponent(btnHouses, Alignment.TRAILING, GroupLayout.DEFAULT_SIZE, 164, Short.MAX_VALUE))
71                                         .addContainerGap(145, Short.MAX_VALUE))
72                 );
73                 gl_contentPane.setVerticalGroup(
74                         gl_contentPane.createParallelGroup(Alignment.LEADING)
75                                 .addGroup(gl_contentPane.createSequentialGroup()
76                                         .addGap(62)
77                                         .addComponent(btnHouses, GroupLayout.PREFERRED_SIZE, 81, GroupLayout.PREFERRED_SIZE)
78                                         .addGap(58)
79                                         .addComponent(btnOffers, GroupLayout.PREFERRED_SIZE, 81, GroupLayout.PREFERRED_SIZE)
80                                         .addPreferredGap(ComponentPlacement.RELATED, 50, Short.MAX_VALUE)
81                                         .addComponent(btnBookings, GroupLayout.PREFERRED_SIZE, 81, GroupLayout.PREFERRED_SIZE)
82                                         .addContainerGap())
83                 );
84                 contentPane.setLayout(gl_contentPane);
85         }
86
87 }