This error is caused by unexpected value we are getting from the registry.
While this is unlikely to be common problem (registry has to be edited manually)
it has sense to make our code more robust.
Submitter just confirmed that he had twicked registry manually:
> The setting that I'm used to set relating to cleartype is
> FontSmoothingGamma, which is a dword value that I set to decimal 650. I
> like my fonts dark. This I set manually. Indeed, after removing this key,
> rebooting, the Java2D app runs normally.
> To try and see whether this has to do with the key just being there or the
> value it has been set at, I tried setting the key with the Microsoft
> powertoy "Cleartype Tuning".
> With this tool I'm not able to set the value any lower than 1000, I
> noticed, and with this value Java2Demo runs fine. Any value lower than
> 1000 and I get the same exception I came across earlier.