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.JButton;
11 import javax.swing.GroupLayout;
12 import javax.swing.GroupLayout.Alignment;
15 import domain.RuralHouse;
17 import java.awt.event.ActionListener;
18 import java.awt.event.ActionEvent;
19 import java.util.Vector;
20 import javax.swing.JLabel;
21 import java.awt.Color;
24 public class HousesRelatedOwnerGUI extends JFrame {
29 private static final long serialVersionUID = 1L;
30 private JPanel contentPane;
35 public HousesRelatedOwnerGUI(Owner o) {
36 this.getContentPane().setLayout(null);
38 setBounds(100, 100, 450, 562);
39 contentPane = new JPanel();
40 contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
41 setContentPane(contentPane);
43 JButton btnCreateHouses = new JButton("Create Houses");
44 btnCreateHouses.addActionListener(new ActionListener() {
45 public void actionPerformed(ActionEvent arg0) {
46 Frame a = new RequestNewHouseGUI(owner);
51 JButton btnModifyHouses = new JButton("Modify Houses");
52 btnModifyHouses.addActionListener(new ActionListener() {
53 public void actionPerformed(ActionEvent e) {
55 Frame a = new ModifyHouseGUI(owner);
61 JButton btnDeleteHouses = new JButton("Delete Houses");
62 btnDeleteHouses.addActionListener(new ActionListener() {
63 public void actionPerformed(ActionEvent e) {
64 Frame a = new RequestDeleteHouseGUI(owner);
68 GroupLayout gl_contentPane = new GroupLayout(contentPane);
69 gl_contentPane.setHorizontalGroup(
70 gl_contentPane.createParallelGroup(Alignment.LEADING)
71 .addGroup(gl_contentPane.createSequentialGroup()
73 .addGroup(gl_contentPane.createParallelGroup(Alignment.TRAILING)
74 .addComponent(btnDeleteHouses, Alignment.LEADING, GroupLayout.DEFAULT_SIZE, 1125, Short.MAX_VALUE)
75 .addComponent(btnModifyHouses, Alignment.LEADING, GroupLayout.DEFAULT_SIZE, 1125, Short.MAX_VALUE)
76 .addComponent(btnCreateHouses, GroupLayout.DEFAULT_SIZE, 1125, Short.MAX_VALUE))
79 gl_contentPane.setVerticalGroup(
80 gl_contentPane.createParallelGroup(Alignment.LEADING)
81 .addGroup(gl_contentPane.createSequentialGroup()
83 .addComponent(btnCreateHouses, GroupLayout.PREFERRED_SIZE, 58, GroupLayout.PREFERRED_SIZE)
85 .addComponent(btnModifyHouses, GroupLayout.PREFERRED_SIZE, 57, GroupLayout.PREFERRED_SIZE)
87 .addComponent(btnDeleteHouses, GroupLayout.PREFERRED_SIZE, 54, GroupLayout.PREFERRED_SIZE)
88 .addContainerGap(394, Short.MAX_VALUE))
90 contentPane.setLayout(gl_contentPane);