Skip to content

Commit 686be8a

Browse files
authored
Add error dialog for employee search failure
Updated the searchClass to display an error message dialog when no employee is found.
1 parent 94dce78 commit 686be8a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/pkg2darr_payrollsystem/searchClass.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,12 @@ public static void Search()
5050

5151
if(!idFound)
5252
{
53-
System.out.println("No Employee found with ID number: ID" + idSearch);
53+
JOptionPane.showMessageDialog(null, "No Employee found with ID number: ID" + idSearch, "NO EMP ID FOUND", JOptionPane.ERROR_MESSAGE);
5454
}
5555

5656
input1 = JOptionPane.showConfirmDialog(null, "Try again searching attempts?", "SEARCH ATTEMPTS", JOptionPane.YES_NO_OPTION);
5757

5858
}while(input1 == JOptionPane.YES_OPTION);
5959
}
6060
}
61+

0 commit comments

Comments
 (0)