3 import java.awt.BorderLayout;
4 import java.awt.EventQueue;
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;
15 import domain.RuralHouse;
17 import java.awt.event.ActionListener;
18 import java.awt.event.ActionEvent;
19 import java.util.Vector;
21 public class OwnerMenuGUI extends JFrame {
26 private static final long serialVersionUID = 1L;
27 private JPanel contentPane;
34 public OwnerMenuGUI(Owner o) {
35 this.getContentPane().setLayout(null);
37 setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
38 setBounds(100, 100, 450, 473);
39 contentPane = new JPanel();
40 contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
41 setContentPane(contentPane);
43 JButton btnHouses = new JButton("Houses");
44 btnHouses.addActionListener(new ActionListener() {
45 public void actionPerformed(ActionEvent e) {
46 Frame a = new HousesRelatedOwnerGUI(owner);
51 JButton btnOffers = new JButton("Offers");
52 btnOffers.addActionListener(new ActionListener() {
53 public void actionPerformed(ActionEvent e) {
54 Frame a = new IntroduceOffer2GUI(owner.getRuralHouses());
58 GroupLayout gl_contentPane = new GroupLayout(contentPane);
59 gl_contentPane.setHorizontalGroup(
60 gl_contentPane.createParallelGroup(Alignment.LEADING)
61 .addGroup(gl_contentPane.createSequentialGroup()
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))
68 gl_contentPane.setVerticalGroup(
69 gl_contentPane.createParallelGroup(Alignment.LEADING)
70 .addGroup(gl_contentPane.createSequentialGroup()
72 .addComponent(btnHouses, GroupLayout.PREFERRED_SIZE, 81, GroupLayout.PREFERRED_SIZE)
74 .addComponent(btnOffers, GroupLayout.PREFERRED_SIZE, 81, GroupLayout.PREFERRED_SIZE)
75 .addContainerGap(142, Short.MAX_VALUE))
77 contentPane.setLayout(gl_contentPane);