RRRRHHHH_Code
Diff Revisions
520867 ...
vs
d7fd17 ...
for ruralHouses/src/gui/listOfRemovalRequestsGUI.java
|
@@ -84,7 +84,7 @@ |
84 |
84 |
|
JButton btnNewButton = new JButton("Confirm Deletion"); |
85 |
85 |
|
btnNewButton.addActionListener(new ActionListener() { |
86 |
86 |
|
public void actionPerformed(ActionEvent e) { |
87 |
|
- |
if (table.getRowCount() != 0) { |
|
87 |
+ |
if (table.getRowCount() != 0 && table.getSelectedRow() != -1) { |
88 |
88 |
|
HouseManagerInterface hm = new HouseManager(); |
89 |
89 |
|
RuralHouse rh = houses.get(table.getSelectedRow()); |
90 |
90 |
|
((DefaultTableModel)table.getModel()).removeRow(houses.indexOf(rh)); |
|
@@ -97,8 +97,25 @@ |
97 |
97 |
|
} |
98 |
98 |
|
} |
99 |
99 |
|
}); |
100 |
|
- |
btnNewButton.setBounds(301, 394, 169, 25); |
|
100 |
+ |
btnNewButton.setBounds(90, 396, 169, 25); |
101 |
101 |
|
contentPane.add(btnNewButton); |
|
102 |
+ |
|
|
103 |
+ |
JButton btnNewButton_1 = new JButton("Deny Deletion"); |
|
104 |
+ |
btnNewButton_1.addActionListener(new ActionListener() { |
|
105 |
+ |
public void actionPerformed(ActionEvent e) { |
|
106 |
+ |
if (table.getRowCount() != 0 && table.getSelectedRow() != -1) { |
|
107 |
+ |
RuralHouse rh = houses.get(table.getSelectedRow()); |
|
108 |
+ |
((DefaultTableModel)table.getModel()).removeRow(houses.indexOf(rh)); |
|
109 |
+ |
houses.remove(rh); |
|
110 |
+ |
am.removeHouseDeletionRequests(rh); |
|
111 |
+ |
Administrator.saveInstance(); |
|
112 |
+ |
|
|
113 |
+ |
|
|
114 |
+ |
} |
|
115 |
+ |
} |
|
116 |
+ |
}); |
|
117 |
+ |
btnNewButton_1.setBounds(291, 396, 169, 25); |
|
118 |
+ |
contentPane.add(btnNewButton_1); |
102 |
119 |
|
while (en.hasMoreElements()) { |
103 |
120 |
|
rh = en.nextElement(); |
104 |
121 |
|
Vector<Object> row = new Vector<Object>(); |