package gui; import java.awt.BorderLayout; import java.awt.EventQueue; import javax.swing.JFrame; import javax.swing.JPanel; import javax.swing.border.EmptyBorder; import javax.swing.JButton; import javax.swing.GroupLayout; import javax.swing.GroupLayout.Alignment; import domain.Owner; import domain.RuralHouse; import java.awt.event.ActionListener; import java.awt.event.ActionEvent; import java.util.Vector; import javax.swing.JLabel; import java.awt.Color; import java.awt.Font; public class HousesRelatedOwnerGUI extends JFrame { /** * */ private static final long serialVersionUID = 1L; private JPanel contentPane; private Owner owner; /** * Create the frame. */ public HousesRelatedOwnerGUI(Owner o) { this.getContentPane().setLayout(null); owner = o; setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); setBounds(100, 100, 450, 562); contentPane = new JPanel(); contentPane.setBorder(new EmptyBorder(5, 5, 5, 5)); setContentPane(contentPane); JButton btnCreateHouses = new JButton("Create Houses"); btnCreateHouses.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent arg0) { //TODO this button must direct to the House create GUI } }); JButton btnModifyHouses = new JButton("Modify Houses"); btnModifyHouses.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { //TODO this button must direct to the House modify GUI } }); JButton btnDeleteHouses = new JButton("Delete Houses"); btnDeleteHouses.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { //TODO this button must direct to the House delete GUI } }); JLabel lblDisabledYet = new JLabel("Disabled yet"); lblDisabledYet.setFont(new Font("Courier New", Font.PLAIN, 19)); lblDisabledYet.setForeground(Color.RED); GroupLayout gl_contentPane = new GroupLayout(contentPane); gl_contentPane.setHorizontalGroup( gl_contentPane.createParallelGroup(Alignment.TRAILING) .addGroup(gl_contentPane.createSequentialGroup() .addGap(110) .addGroup(gl_contentPane.createParallelGroup(Alignment.TRAILING) .addComponent(btnDeleteHouses, Alignment.LEADING, GroupLayout.DEFAULT_SIZE, 193, Short.MAX_VALUE) .addComponent(btnModifyHouses, Alignment.LEADING, GroupLayout.DEFAULT_SIZE, 193, Short.MAX_VALUE) .addComponent(btnCreateHouses, GroupLayout.DEFAULT_SIZE, 193, Short.MAX_VALUE)) .addGap(121)) .addGroup(Alignment.LEADING, gl_contentPane.createSequentialGroup() .addGap(127) .addComponent(lblDisabledYet) .addContainerGap(165, Short.MAX_VALUE)) ); gl_contentPane.setVerticalGroup( gl_contentPane.createParallelGroup(Alignment.LEADING) .addGroup(gl_contentPane.createSequentialGroup() .addGap(37) .addComponent(lblDisabledYet) .addGap(28) .addComponent(btnCreateHouses, GroupLayout.PREFERRED_SIZE, 58, GroupLayout.PREFERRED_SIZE) .addGap(40) .addComponent(btnModifyHouses, GroupLayout.PREFERRED_SIZE, 57, GroupLayout.PREFERRED_SIZE) .addGap(39) .addComponent(btnDeleteHouses, GroupLayout.PREFERRED_SIZE, 54, GroupLayout.PREFERRED_SIZE) .addContainerGap(186, Short.MAX_VALUE)) ); contentPane.setLayout(gl_contentPane); } }