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.LayoutStyle.ComponentPlacement;
13 import javax.swing.border.EmptyBorder;
17 public class OwnerMenuGUI extends JFrame {
22 private static final long serialVersionUID = 1L;
23 private JPanel contentPane;
30 public OwnerMenuGUI(Owner o) {
31 this.setTitle("Owner Menu");
32 this.getContentPane().setLayout(null);
34 setBounds(100, 100, 450, 473);
35 contentPane = new JPanel();
36 contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
37 setContentPane(contentPane);
39 JButton btnHouses = new JButton("Houses");
40 btnHouses.addActionListener(new ActionListener() {
41 public void actionPerformed(ActionEvent e) {
42 Frame a = new HousesRelatedOwnerGUI(owner);
47 JButton btnOffers = new JButton("Offers");
48 btnOffers.addActionListener(new ActionListener() {
49 public void actionPerformed(ActionEvent e) {
50 Frame a = new OffersRelatedOwnerGUI(owner);
55 JButton btnBookings = new JButton("Bookings");
56 btnBookings.addActionListener(new ActionListener() {
57 public void actionPerformed(ActionEvent e) {
58 Frame a = new listOfOffers(owner);
62 GroupLayout gl_contentPane = new GroupLayout(contentPane);
63 gl_contentPane.setHorizontalGroup(
64 gl_contentPane.createParallelGroup(Alignment.LEADING)
65 .addGroup(gl_contentPane.createSequentialGroup()
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))
73 gl_contentPane.setVerticalGroup(
74 gl_contentPane.createParallelGroup(Alignment.LEADING)
75 .addGroup(gl_contentPane.createSequentialGroup()
77 .addComponent(btnHouses, GroupLayout.PREFERRED_SIZE, 81, GroupLayout.PREFERRED_SIZE)
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)
84 contentPane.setLayout(gl_contentPane);