package eecs1022; import javax.swing.JOptionPane; public class Prime { public static void main(String[] args) { String input = JOptionPane.showInputDialog("Enter an integer"); int i = Integer.parseInt(input); boolean isPrime = true; for (int j = 2; j < i; j++) { if (i % j == 0) { isPrime = false; } } if (isPrime) { System.out.printf("The integer %d is prime", i); } else { System.out.printf("The integer %d is not prime", i); } } }