The conditional needs a boolean, so you must use a boolean, or in this case compare the two integers using '=='. In addition, the API for JOptionPane explicitly states what is returned for this...