import java.awt.EventQueue;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
+import java.util.Vector;
import javax.swing.JFrame;
import javax.swing.JPanel;
* Create the frame.
*/
public DeleteHouseGUI(Owner o) {
- owner = o;
+ this.owner = o;
setBounds(100, 100, 450, 300);
contentPane = new JPanel();
contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
setContentPane(contentPane);
-
- comboBox = new JComboBox(o.getRuralHouses());
+
+ comboBox = new JComboBox(this.owner.getRuralHouses());
+
JRadioButton rdbtnIAmSure = new JRadioButton("I am sure");
JButton btnDelete = new JButton("DELETE");
RuralHouse toDel = (RuralHouse)comboBox.getSelectedItem();
HouseManagerInterface hm = new HouseManager();
- hm.removeHouse(toDel.getHouseName());
+ hm.removeHouse(toDel,this.owner);
+ comboBox.removeItem(toDel);
}
}