DeleteOffers and Modify Offers completed, both logic and GUI
[RRRRHHHH_Code] / ruralHouses / src / gui / OwnerMenuGUI.java
1 package gui;
2
3 import java.awt.BorderLayout;
4 import java.awt.EventQueue;
5 import java.awt.Frame;
6
7 import javax.swing.JFrame;
8 import javax.swing.JPanel;
9 import javax.swing.border.EmptyBorder;
10 import javax.swing.GroupLayout;
11 import javax.swing.GroupLayout.Alignment;
12 import javax.swing.JButton;
13
14 import domain.Owner;
15 import domain.RuralHouse;
16
17 import java.awt.event.ActionListener;
18 import java.awt.event.ActionEvent;
19 import java.util.Vector;
20
21 public class OwnerMenuGUI extends JFrame {
22
23         /**
24          * 
25          */
26         private static final long serialVersionUID = 1L;
27         private JPanel contentPane;
28         private Owner owner;
29
30
31         /**
32          * Create the frame.
33          */
34         public OwnerMenuGUI(Owner o) {
35                 this.setTitle("Owner Menu");
36                 this.getContentPane().setLayout(null);
37                 owner = o;
38                 setBounds(100, 100, 450, 473);
39                 contentPane = new JPanel();
40                 contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
41                 setContentPane(contentPane);
42                 
43                 JButton btnHouses = new JButton("Houses");
44                 btnHouses.addActionListener(new ActionListener() {
45                         public void actionPerformed(ActionEvent e) {
46                                 Frame a = new HousesRelatedOwnerGUI(owner);
47                                 a.setVisible(true);
48                         }
49                 });
50                 
51                 JButton btnOffers = new JButton("Offers");
52                 btnOffers.addActionListener(new ActionListener() {
53                         public void actionPerformed(ActionEvent e) {
54                                 Frame a = new OffersRelatedOwnerGUI(owner);
55                                 a.setVisible(true);
56                         }
57                 });
58                 GroupLayout gl_contentPane = new GroupLayout(contentPane);
59                 gl_contentPane.setHorizontalGroup(
60                         gl_contentPane.createParallelGroup(Alignment.LEADING)
61                                 .addGroup(gl_contentPane.createSequentialGroup()
62                                         .addGap(115)
63                                         .addGroup(gl_contentPane.createParallelGroup(Alignment.LEADING)
64                                                 .addComponent(btnOffers, GroupLayout.PREFERRED_SIZE, 164, GroupLayout.PREFERRED_SIZE)
65                                                 .addComponent(btnHouses, GroupLayout.PREFERRED_SIZE, 164, GroupLayout.PREFERRED_SIZE))
66                                         .addContainerGap(145, Short.MAX_VALUE))
67                 );
68                 gl_contentPane.setVerticalGroup(
69                         gl_contentPane.createParallelGroup(Alignment.LEADING)
70                                 .addGroup(gl_contentPane.createSequentialGroup()
71                                         .addGap(62)
72                                         .addComponent(btnHouses, GroupLayout.PREFERRED_SIZE, 81, GroupLayout.PREFERRED_SIZE)
73                                         .addGap(58)
74                                         .addComponent(btnOffers, GroupLayout.PREFERRED_SIZE, 81, GroupLayout.PREFERRED_SIZE)
75                                         .addContainerGap(142, Short.MAX_VALUE))
76                 );
77                 contentPane.setLayout(gl_contentPane);
78         }
79
80 }