charText is a variable of type char, so it won't ever be null - rather it should have some numeric value.

The output from


System.out.println(""+charText+" is null.");


should have told...