I think you're having an issue here -
String output = number + " is"
+ (BigInteger(input) ? " " : " not ") + "a prime number: "
+ BigInteger(input);
And you want something more like this -
String output = num + " is"
+ (IsPrime(num) ? " " : " not ") + "a prime number.";
I tested your IsPrime
function, and it correctly identified 5 as prime and 4 as not prime. You should probably rename it isPrime
to be inline with Java naming conventions.
EDIT
public static void main(String[] args) {
// prompt user to input a number
String input = JOptionPane.showInputDialog("Enter number ");
// change string to int
int number = Integer.parseInt(input);
// display message to user of their results
BigInteger num = new BigInteger(input);
String output = num + " is" + (IsPrime(num) ? " " : " not ")
+ "a prime number.";
JOptionPane.showMessageDialog(null, output);
}