private RuralHouse rh;
private JTextField telIn;
private int row;
+ private JLabel phoneNum;
/**
* 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);
+
+ phoneNum = new JLabel("");
+ phoneNum.setBounds(215, 255, 201, 15);
+ contentPane.add(phoneNum);
table.addMouseListener( new MouseAdapter(){
@Override
public void mouseClicked(MouseEvent arg0) {
private void jButton_ActionPerformed(ActionEvent arg0) {
BookingManager bookingM = new BookingManager();
//RegExp to see if telephone number is correct??TODO
+ if (!telIn.getText().matches("[976]\\d{2}[.\\- ]?\\d{3}[.\\- ]?\\d{3}")){
+ phoneNum.setText("Wrong phone format");
+ }else {
+ phoneNum.setText("");
+
Booking book = null;
try {
if (table.getRowCount()!=0)
book);
confirmWindow.setVisible(true);
}
+ }
}
}
private JTextField baths_f;
private JButton btnConfirm;
private JComboBox<RuralHouse> houseBox;
+ private JComboBox<String> comboBox;
private RuralHouse rh;
/**
*/
public ModifyHouseGUI(Owner o) {
this.distric=Districs.longNames();
- JComboBox<String> comboBox = new JComboBox<String>(new DefaultComboBoxModel<String>(
+ 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
private JTextField baths_f;
private JButton btnRegister;
private AdminManager am;
- private JComboBox comboBox;
+ private JComboBox<String> comboBox;
/**
* Create the frame.
*/
public RequestNewHouseGUI(Owner o) {
- JComboBox<String> comboBox = new JComboBox<String>(new DefaultComboBoxModel<String>(
+ comboBox = new JComboBox<String>(new DefaultComboBoxModel<String>(
Districs.longNames()));
am = new AdminManager();
this.setTitle("New House");