Fixed if statement and made it JOptionPane