diff --git a/src/main/java/com/seg83/childbank/gui/component/taskpanel/TaskPop.java b/src/main/java/com/seg83/childbank/gui/component/taskpanel/TaskPop.java index 98d54df..1bdc8ec 100644 --- a/src/main/java/com/seg83/childbank/gui/component/taskpanel/TaskPop.java +++ b/src/main/java/com/seg83/childbank/gui/component/taskpanel/TaskPop.java @@ -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); @@ -182,4 +186,4 @@ public void init() { return contentPane; } -} \ No newline at end of file +}