*/
public listOfRemovalRequestsGUI() {
try {
- am = (AdminInterface) Naming
- .lookup(___IntNames.AdminManager);
+ am = (AdminInterface) Naming.lookup(___IntNames.AdminManager);
} catch (Exception e1) {
System.out.println("Error accessing remote authentication: "
+ e1.toString());
btnNewButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
if (table.getRowCount() != 0 && table.getSelectedRow() != -1) {
- HouseInterface hm= null;
+ HouseInterface hm = null;
try {
hm = (HouseInterface) Naming
.lookup(___IntNames.HouseManager);
} catch (Exception e1) {
- System.out.println("Error accessing remote authentication: "
- + e1.toString());
+ System.out
+ .println("Error accessing remote authentication: "
+ + e1.toString());
}
RuralHouse rh = houses.get(table.getSelectedRow());
- ((DefaultTableModel)table.getModel()).removeRow(houses.indexOf(rh));
- try {
- hm.removeHouse(rh, rh.getOwner());
- am.removeHouseDeletionRequests(rh);
- am.saveInstance();
- } catch (RemoteException e1) {
- // TODO Auto-generated catch block
- e1.printStackTrace();
- }
- houses.remove(rh);
-
-
-
+
+ try {
+ hm.removeHouse(rh, rh.getOwner());
+ am.removeHouseDeletionRequests(rh);
+ am.saveInstance();
+ } catch (RemoteException e1) {
+ e1.printStackTrace();
+ }
+ ((DefaultTableModel) table.getModel()).removeRow(houses
+ .indexOf(rh));
+ houses.remove(rh);
+
}
}
});
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);
- try {
- am.removeHouseDeletionRequests(rh);
- am.saveInstance();
- } catch (RemoteException e1) {
- // TODO Auto-generated catch block
- e1.printStackTrace();
- }
-
-
-
+ ((DefaultTableModel) table.getModel()).removeRow(houses
+ .indexOf(rh));
+ houses.remove(rh);
+ try {
+ am.removeHouseDeletionRequests(rh);
+ am.saveInstance();
+ } catch (RemoteException e1) {
+ // TODO Auto-generated catch block
+ e1.printStackTrace();
+ }
+
}
}
});