Git Repository Public Repository

RRRRHHHH_Code

URLs

Copy to Clipboard

Diff Revisions d30bcc ... vs ccac99 ... for ruralHouses/src/gui/listOfRemovalRequestsGUI.java

Diff revisions: vs.
  @@ -41,8 +41,7 @@
41 41 */
42 42 public listOfRemovalRequestsGUI() {
43 43 try {
44 - am = (AdminInterface) Naming
45 - .lookup(___IntNames.AdminManager);
44 + am = (AdminInterface) Naming.lookup(___IntNames.AdminManager);
46 45 } catch (Exception e1) {
47 46 System.out.println("Error accessing remote authentication: "
48 47 + e1.toString());
  @@ -94,51 +93,50 @@
94 93 btnNewButton.addActionListener(new ActionListener() {
95 94 public void actionPerformed(ActionEvent e) {
96 95 if (table.getRowCount() != 0 && table.getSelectedRow() != -1) {
97 - HouseInterface hm= null;
96 + HouseInterface hm = null;
98 97 try {
99 98 hm = (HouseInterface) Naming
100 99 .lookup(___IntNames.HouseManager);
101 100 } catch (Exception e1) {
102 - System.out.println("Error accessing remote authentication: "
103 - + e1.toString());
101 + System.out
102 + .println("Error accessing remote authentication: "
103 + + e1.toString());
104 104 }
105 105 RuralHouse rh = houses.get(table.getSelectedRow());
106 - ((DefaultTableModel)table.getModel()).removeRow(houses.indexOf(rh));
107 - try {
108 - hm.removeHouse(rh, rh.getOwner());
109 - am.removeHouseDeletionRequests(rh);
110 - am.saveInstance();
111 - } catch (RemoteException e1) {
112 - // TODO Auto-generated catch block
113 - e1.printStackTrace();
114 - }
115 - houses.remove(rh);
116 -
117 106
118 -
107 + try {
108 + hm.removeHouse(rh, rh.getOwner());
109 + am.removeHouseDeletionRequests(rh);
110 + am.saveInstance();
111 + } catch (RemoteException e1) {
112 + e1.printStackTrace();
113 + }
114 + ((DefaultTableModel) table.getModel()).removeRow(houses
115 + .indexOf(rh));
116 + houses.remove(rh);
117 +
119 118 }
120 119 }
121 120 });
122 121 btnNewButton.setBounds(90, 396, 169, 25);
123 122 contentPane.add(btnNewButton);
124 -
123 +
125 124 JButton btnNewButton_1 = new JButton("Deny Deletion");
126 125 btnNewButton_1.addActionListener(new ActionListener() {
127 126 public void actionPerformed(ActionEvent e) {
128 127 if (table.getRowCount() != 0 && table.getSelectedRow() != -1) {
129 128 RuralHouse rh = houses.get(table.getSelectedRow());
130 - ((DefaultTableModel)table.getModel()).removeRow(houses.indexOf(rh));
131 - houses.remove(rh);
132 - try {
133 - am.removeHouseDeletionRequests(rh);
134 - am.saveInstance();
135 - } catch (RemoteException e1) {
136 - // TODO Auto-generated catch block
137 - e1.printStackTrace();
138 - }
139 -
129 + ((DefaultTableModel) table.getModel()).removeRow(houses
130 + .indexOf(rh));
131 + houses.remove(rh);
132 + try {
133 + am.removeHouseDeletionRequests(rh);
134 + am.saveInstance();
135 + } catch (RemoteException e1) {
136 + // TODO Auto-generated catch block
137 + e1.printStackTrace();
138 + }
140 139
141 -
142 140 }
143 141 }
144 142 });