Merge branch 'master' of https://xp-dev.com/git/RRRRHHHH_Code
[RRRRHHHH_Code] / ruralHouses / src / gui / ModifyHouseGUI.java
index 6d980d1..6b64b19 100644 (file)
@@ -46,8 +46,8 @@ public class ModifyHouseGUI extends JFrame {
        private JTextField baths_f;
        private JButton btnConfirm;
        private JComboBox<RuralHouse> houseBox;
        private JTextField baths_f;
        private JButton btnConfirm;
        private JComboBox<RuralHouse> houseBox;
-       private RuralHouse rh;
        private  JComboBox<String> comboBox;
        private  JComboBox<String> comboBox;
+       private RuralHouse rh;
 
        /**
         * Create the frame.
 
        /**
         * Create the frame.
@@ -55,6 +55,7 @@ public class ModifyHouseGUI extends JFrame {
        public ModifyHouseGUI(final Owner o) {
                this.distric=Districs.longNames();
                 comboBox = new JComboBox<String>(new DefaultComboBoxModel<String>(
        public ModifyHouseGUI(final Owner o) {
                this.distric=Districs.longNames();
                 comboBox = new JComboBox<String>(new DefaultComboBoxModel<String>(
+
                                this.distric));
                this.getContentPane().setLayout(null);
                owner = o;
                                this.distric));
                this.getContentPane().setLayout(null);
                owner = o;
@@ -134,8 +135,8 @@ public class ModifyHouseGUI extends JFrame {
                                HouseManager hm = new HouseManager();
 
                                if (hm.registerNewHouse(newRh)) {
                                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
                                        houseBox.removeItem(rh);
                                        feedback.setText("House properly modified");
                                } else