package gui; import java.awt.BorderLayout; import java.awt.EventQueue; import java.awt.Frame; import javax.swing.JFrame; import javax.swing.JPanel; import javax.swing.border.EmptyBorder; import javax.swing.GroupLayout; import javax.swing.GroupLayout.Alignment; import javax.swing.JButton; import domain.Owner; import domain.RuralHouse; import java.awt.event.ActionListener; import java.awt.event.ActionEvent; import java.util.Vector; public class OwnerMenuGUI extends JFrame { /** * */ private static final long serialVersionUID = 1L; private JPanel contentPane; private Owner owner; /** * Create the frame. */ public OwnerMenuGUI(Owner o) { this.setTitle("Owner Menu"); this.getContentPane().setLayout(null); owner = o; setBounds(100, 100, 450, 473); contentPane = new JPanel(); contentPane.setBorder(new EmptyBorder(5, 5, 5, 5)); setContentPane(contentPane); JButton btnHouses = new JButton("Houses"); btnHouses.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { Frame a = new HousesRelatedOwnerGUI(owner); a.setVisible(true); } }); JButton btnOffers = new JButton("Offers"); btnOffers.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { Frame a = new OffersRelatedOwnerGUI(owner); a.setVisible(true); } }); GroupLayout gl_contentPane = new GroupLayout(contentPane); gl_contentPane.setHorizontalGroup( gl_contentPane.createParallelGroup(Alignment.LEADING) .addGroup(gl_contentPane.createSequentialGroup() .addGap(115) .addGroup(gl_contentPane.createParallelGroup(Alignment.LEADING) .addComponent(btnOffers, GroupLayout.PREFERRED_SIZE, 164, GroupLayout.PREFERRED_SIZE) .addComponent(btnHouses, GroupLayout.PREFERRED_SIZE, 164, GroupLayout.PREFERRED_SIZE)) .addContainerGap(145, Short.MAX_VALUE)) ); gl_contentPane.setVerticalGroup( gl_contentPane.createParallelGroup(Alignment.LEADING) .addGroup(gl_contentPane.createSequentialGroup() .addGap(62) .addComponent(btnHouses, GroupLayout.PREFERRED_SIZE, 81, GroupLayout.PREFERRED_SIZE) .addGap(58) .addComponent(btnOffers, GroupLayout.PREFERRED_SIZE, 81, GroupLayout.PREFERRED_SIZE) .addContainerGap(142, Short.MAX_VALUE)) ); contentPane.setLayout(gl_contentPane); } }