|
@@ -31,7 +31,6 @@ |
31 |
31 |
|
public class listOfHousesGUI extends JFrame { |
32 |
32 |
|
|
33 |
33 |
|
private JPanel contentPane; |
34 |
|
- |
private JTextField textField; |
35 |
34 |
|
private JTable table; |
36 |
35 |
|
private DefaultTableModel tableModel; |
37 |
36 |
|
|
|
@@ -53,22 +52,14 @@ |
53 |
52 |
|
setContentPane(contentPane); |
54 |
53 |
|
contentPane.setLayout(null); |
55 |
54 |
|
|
56 |
|
- |
JLabel lblNewLabel = new JLabel("List of available houses in:"); |
|
55 |
+ |
JLabel lblNewLabel = new JLabel(); |
57 |
56 |
|
lblNewLabel.setFont(new Font("Tahoma", Font.PLAIN, 27)); |
58 |
|
- |
lblNewLabel.setBounds(23, 41, 325, 33); |
|
57 |
+ |
lblNewLabel.setBounds(23, 41, 536, 33); |
59 |
58 |
|
contentPane.add(lblNewLabel); |
60 |
|
- |
|
61 |
|
- |
textField = new JTextField(); |
62 |
|
- |
textField.setEnabled(false); |
63 |
|
- |
textField.setEditable(false); |
64 |
|
- |
textField.setFont(new Font("Tahoma", Font.PLAIN, 27)); |
65 |
|
- |
textField.setBounds(373, 41, 152, 33); |
66 |
|
- |
contentPane.add(textField); |
67 |
|
- |
textField.setColumns(10); |
68 |
59 |
|
if (houses.isEmpty()) |
69 |
|
- |
textField.setText("No houses Matching"); |
|
60 |
+ |
lblNewLabel.setText("There are not houses matching your search"); |
70 |
61 |
|
else |
71 |
|
- |
textField.setText(houses.get(0).getDistrict()); |
|
62 |
+ |
lblNewLabel.setText("List of houses that match your search:"); |
72 |
63 |
|
JScrollPane scrollPane = new JScrollPane(); |
73 |
64 |
|
scrollPane.setBounds(new Rectangle(45, 305, 320, 116)); |
74 |
65 |
|
scrollPane.setBounds(23, 113, 536, 271); |
|
@@ -80,7 +71,7 @@ |
80 |
71 |
|
"House Name", "Bedrooms", "Kitchens", "Baths", "Parkings", |
81 |
72 |
|
"Livings" }); |
82 |
73 |
|
//Maybe there is a better way to avoid interaction. |
83 |
|
- |
table.setEnabled(false); |
|
74 |
+ |
//table.setEnabled(false); |
84 |
75 |
|
table.setModel(tableModel); |
85 |
76 |
|
Enumeration<RuralHouse> en = houses.elements(); |
86 |
77 |
|
RuralHouse rh; |
|
@@ -94,7 +85,6 @@ |
94 |
85 |
|
row.add(rh.getFeatures().getnBaths()); |
95 |
86 |
|
row.add(rh.getFeatures().getnParkings()); |
96 |
87 |
|
row.add(rh.getFeatures().getnLivings()); |
97 |
|
- |
System.out.println(rh.getFeatures().getnLivings()); |
98 |
88 |
|
tableModel.addRow(row); |
99 |
89 |
|
} |
100 |
90 |
|
|