}
}
+
/**
* This method creates an offer with a house number, first day, last day and price
private int row;
private JLabel labelPhone;
+
/**
* Create the frame.
*/
JLabel lblNewLabel = new JLabel(
"Green: Suit your dates. Red: Do not suit your dates");
lblNewLabel.setEnabled(false);
- lblNewLabel.setBounds(152, 277, 261, 23);
+ lblNewLabel.setBounds(170, 282, 261, 23);
contentPane.add(lblNewLabel);
JLabel lblNewLabel_1 = new JLabel("Telephone num:");
telIn.setBounds(99, 505, 129, 20);
contentPane.add(telIn);
telIn.setColumns(10);
-
+
labelPhone = new JLabel("");
labelPhone.setBounds(238, 252, 178, 14);
contentPane.add(labelPhone);
+
table.addMouseListener( new MouseAdapter(){
@Override
public void mouseClicked(MouseEvent arg0) {
}
} else {
labelPhone.setText("Phone format is wrong");
+
+
}
}
}
private JTextField baths_f;
private JButton btnConfirm;
private JComboBox<RuralHouse> houseBox;
- private RuralHouse rh;
private JComboBox<String> comboBox;
+ private RuralHouse rh;
/**
* Create the frame.
public ModifyHouseGUI(final Owner o) {
this.distric=Districs.longNames();
comboBox = new JComboBox<String>(new DefaultComboBoxModel<String>(
+
this.distric));
this.getContentPane().setLayout(null);
owner = o;
HouseManager hm = new HouseManager();
if (hm.registerNewHouse(newRh)) {
- o.getRuralHouses().remove(rh);
- o.getRuralHouses().add(newRh);
+ owner.getRuralHouses().remove(rh);
+ owner.getRuralHouses().add(newRh);
houseBox.removeItem(rh);
feedback.setText("House properly modified");
} else
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
c=configuration.ConfigXML.getInstance();
-
+
}catch (com.db4o.ext.DatabaseFileLockedException e) {
a.lblNewLabel.setText("Database locked: Do not run BusinessLogicServer or BusinessLogicServer!!");
a.lblNewLabel.setForeground(Color.RED);
RuralHouse rh = houses.get(table.getSelectedRow());
//TODO when the house is not added show a warning to the user. Method below returns a boolean stating that.
hm.registerNewHouse(rh);
- houses.remove(rh);
am.removeHouseAdditionRequests(rh);
Administrator.saveInstance();
((DefaultTableModel)table.getModel()).removeRow(houses.indexOf(rh));
+ houses.remove(rh);
}
}
});