House features gui created
[RRRRHHHH_Code] / ruralHouses / src / gui / listOfHousesGUI.java
index 0478466..0b6429b 100644 (file)
@@ -31,7 +31,6 @@ import javax.swing.Box;
 public class listOfHousesGUI extends JFrame {
 
        private JPanel contentPane;
-       private JTextField textField;
        private JTable table;
        private DefaultTableModel tableModel;
 
@@ -53,22 +52,14 @@ public class listOfHousesGUI extends JFrame {
                setContentPane(contentPane);
                contentPane.setLayout(null);
 
-               JLabel lblNewLabel = new JLabel("List of available houses in:");
+               JLabel lblNewLabel = new JLabel();
                lblNewLabel.setFont(new Font("Tahoma", Font.PLAIN, 27));
-               lblNewLabel.setBounds(23, 41, 325, 33);
+               lblNewLabel.setBounds(23, 41, 536, 33);
                contentPane.add(lblNewLabel);
-
-               textField = new JTextField();
-               textField.setEnabled(false);
-               textField.setEditable(false);
-               textField.setFont(new Font("Tahoma", Font.PLAIN, 27));
-               textField.setBounds(373, 41, 152, 33);
-               contentPane.add(textField);
-               textField.setColumns(10);
                if (houses.isEmpty())
-                       textField.setText("No houses Matching");
+                       lblNewLabel.setText("There are not houses matching your search");
                else
-                       textField.setText(houses.get(0).getDistrict());
+                       lblNewLabel.setText("List of houses that match your search:");
                JScrollPane scrollPane = new JScrollPane();
                scrollPane.setBounds(new Rectangle(45, 305, 320, 116));
                scrollPane.setBounds(23, 113, 536, 271);
@@ -80,7 +71,7 @@ public class listOfHousesGUI extends JFrame {
                                "House Name", "Bedrooms", "Kitchens", "Baths", "Parkings",
                                "Livings" });
                //Maybe there is a better way to avoid interaction.
-               table.setEnabled(false);
+               //table.setEnabled(false);
                table.setModel(tableModel);
                Enumeration<RuralHouse> en = houses.elements();
                RuralHouse rh;
@@ -94,7 +85,6 @@ public class listOfHousesGUI extends JFrame {
                        row.add(rh.getFeatures().getnBaths());
                        row.add(rh.getFeatures().getnParkings());
                        row.add(rh.getFeatures().getnLivings());
-                       System.out.println(rh.getFeatures().getnLivings());
                        tableModel.addRow(row);
                }