Started creating the booking interface for the owners.
[RRRRHHHH_Code] / ruralHouses / src / gui / listOfRemovalRequestsGUI.java
index 53cb7e6..43db732 100644 (file)
@@ -84,7 +84,7 @@ public class listOfRemovalRequestsGUI extends JFrame {
                JButton btnNewButton = new JButton("Confirm Deletion");
                btnNewButton.addActionListener(new ActionListener() {
                        public void actionPerformed(ActionEvent e) {
-                               if (table.getRowCount() != 0) {
+                               if (table.getRowCount() != 0 && table.getSelectedRow() != -1) {
                                        HouseManagerInterface hm = new HouseManager();
                                        RuralHouse rh = houses.get(table.getSelectedRow());
                                        ((DefaultTableModel)table.getModel()).removeRow(houses.indexOf(rh));
@@ -97,8 +97,25 @@ public class listOfRemovalRequestsGUI extends JFrame {
                                }
                        }
                });
-               btnNewButton.setBounds(301, 394, 169, 25);
+               btnNewButton.setBounds(90, 396, 169, 25);
                contentPane.add(btnNewButton);
+               
+               JButton btnNewButton_1 = new JButton("Deny Deletion");
+               btnNewButton_1.addActionListener(new ActionListener() {
+                       public void actionPerformed(ActionEvent e) {
+                               if (table.getRowCount() != 0 && table.getSelectedRow() != -1) {
+                                       RuralHouse rh = houses.get(table.getSelectedRow());
+                                       ((DefaultTableModel)table.getModel()).removeRow(houses.indexOf(rh));
+                                               houses.remove(rh);
+                                               am.removeHouseDeletionRequests(rh);
+                                               Administrator.saveInstance();
+
+                                       
+                               }
+                       }
+               });
+               btnNewButton_1.setBounds(291, 396, 169, 25);
+               contentPane.add(btnNewButton_1);
                while (en.hasMoreElements()) {
                        rh = en.nextElement();
                        Vector<Object> row = new Vector<Object>();