4 import java.awt.event.ActionEvent;
5 import java.awt.event.ActionListener;
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;
16 public class OwnerMenuGUI extends JFrame {
21 private static final long serialVersionUID = 1L;
22 private JPanel contentPane;
29 public OwnerMenuGUI(Owner o) {
30 this.setTitle("Owner Menu");
31 this.getContentPane().setLayout(null);
33 setBounds(100, 100, 450, 473);
34 contentPane = new JPanel();
35 contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
36 setContentPane(contentPane);
38 JButton btnHouses = new JButton("Houses");
39 btnHouses.addActionListener(new ActionListener() {
40 public void actionPerformed(ActionEvent e) {
41 Frame a = new HousesRelatedOwnerGUI(owner);
46 JButton btnOffers = new JButton("Offers");
47 btnOffers.addActionListener(new ActionListener() {
48 public void actionPerformed(ActionEvent e) {
49 Frame a = new OffersRelatedOwnerGUI(owner);
53 GroupLayout gl_contentPane = new GroupLayout(contentPane);
54 gl_contentPane.setHorizontalGroup(
55 gl_contentPane.createParallelGroup(Alignment.LEADING)
56 .addGroup(gl_contentPane.createSequentialGroup()
58 .addGroup(gl_contentPane.createParallelGroup(Alignment.LEADING)
59 .addComponent(btnOffers, GroupLayout.PREFERRED_SIZE, 164, GroupLayout.PREFERRED_SIZE)
60 .addComponent(btnHouses, GroupLayout.PREFERRED_SIZE, 164, GroupLayout.PREFERRED_SIZE))
61 .addContainerGap(145, Short.MAX_VALUE))
63 gl_contentPane.setVerticalGroup(
64 gl_contentPane.createParallelGroup(Alignment.LEADING)
65 .addGroup(gl_contentPane.createSequentialGroup()
67 .addComponent(btnHouses, GroupLayout.PREFERRED_SIZE, 81, GroupLayout.PREFERRED_SIZE)
69 .addComponent(btnOffers, GroupLayout.PREFERRED_SIZE, 81, GroupLayout.PREFERRED_SIZE)
70 .addContainerGap(142, Short.MAX_VALUE))
72 contentPane.setLayout(gl_contentPane);