Hello everyone!
I'm in school and just starting to handle java and I'm having an issue with some code.
package ticketnumber;
import java.util.Scanner;
import javax.swing.JOptionPane;
public class TicketNumber {
public static void main(String[] args)
{
Scanner in = new Scanner(System.in);
int num, num2, remainder1, remainder2;
Boolean result;
// JOptionPane.showMessageDialog(null, "Messagehere", "Title here", JOptionPane.PLAIN_MESSAGE);
System.out.print("Enter your ticket number: ");
num = in.nextInt();
num2 = num/10;
remainder1 = num%10;
remainder2 = num2%7;
result = (remainder1 == remainder2);
System.out.println(num+" "+num2+" "+remainder1+" "+remainder2+" "+result);
JOptionPane.showMessageDialog (
null, result, "Ticket Validation", JOptionPane.PLAIN_MESSAGE);
System.exit ( 0 );
}
}
If you uncomment the first JOptionPane the code works correctly. With the comment in place the program simply hangs I'm assuming expecting more input? Any help at all would be appreciated.
-Thanks