Skip to content

Commit

Permalink
Update TaskPop.java
Browse files Browse the repository at this point in the history
  • Loading branch information
Jchhhh authored May 26, 2024
1 parent b98a217 commit df8ede2
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,10 @@ private void onOK() {

// id should be a number
try {
if (id <= 0) {
JOptionPane.showMessageDialog(this, "Task No. should be a positive number", "Error", JOptionPane.ERROR_MESSAGE);
return;
}
id = Long.parseLong(textField1.getText());
} catch (NumberFormatException e) {
JOptionPane.showMessageDialog(this, "Task No. should be a number", "Error", JOptionPane.ERROR_MESSAGE);
Expand Down Expand Up @@ -182,4 +186,4 @@ public void init() {
return contentPane;
}

}
}

0 comments on commit df8ede2

Please sign in to comment.