Skip to content

Commit

Permalink
add handle exceptions
Browse files Browse the repository at this point in the history
  • Loading branch information
ygy36 authored and ygy36 committed Oct 18, 2020
1 parent b834cf3 commit d476fa8
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/MainWindow.java
Original file line number Diff line number Diff line change
Expand Up @@ -164,10 +164,14 @@ public void widgetSelected(SelectionEvent e) {
@Override
public void widgetSelected(SelectionEvent e) {
if (file != null) {
String tag = table.getItem(table.getSelectionIndex()).getText();
TagManagement.remove(tag, file);
table.remove(table.getSelectionIndex());
lblTagNum.setText("This file has " + TagManagement.getSet().size() + " tag(s)");
try {
String tag = table.getItem(table.getSelectionIndex()).getText();
TagManagement.remove(tag, file);
table.remove(table.getSelectionIndex());
lblTagNum.setText("This file has " + TagManagement.getSet().size() + " tag(s)");
} catch (Exception e2) {
e2.printStackTrace();
}
}
}
});
Expand Down

0 comments on commit d476fa8

Please sign in to comment.