import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
-
import javax.swing.DefaultComboBoxModel;
import javax.swing.JButton;
import javax.swing.JComboBox;
private JTextField baths_f;
private JButton btnConfirm;
private JComboBox<RuralHouse> houseBox;
+ private JComboBox<String> comboBox;
private RuralHouse rh;
/**
* Create the frame.
*/
- public ModifyHouseGUI(Owner o) {
+ public ModifyHouseGUI(final 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