United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: JDK-6503988 Applets, applications with fonts/graphics won't run
JDK-6503988 : Applets, applications with fonts/graphics won't run

Details
Type:
Bug
Submit Date:
2006-12-13
Status:
Closed
Updated Date:
2011-03-08
Project Name:
JDK
Resolved Date:
2011-03-08
Component:
client-libs
OS:
windows_xp
Sub-Component:
2d
CPU:
x86
Priority:
P4
Resolution:
Fixed
Affected Versions:
6,6u10,6u16
Fixed Versions:

Related Reports
Duplicate:

Sub Tasks

Description
FULL PRODUCT VERSION :
$java -version
java version "1.6.0"
Java(TM) SE Runtime Environment (build 1.6.0-b105)
Java HotSpot(TM) Client VM (build 1.6.0-b105, mixed mode, sharing)

ADDITIONAL OS VERSION INFORMATION :
Microsoft Windows XP [Version 5.1.2600]

A DESCRIPTION OF THE PROBLEM :
Just installed the release version of java 6. When trying to run the applet Java2Demo I get this in return:

$java -jar Java2Demo.jar
Exception in thread "main" java.lang.ExceptionInInitializerError
        at javax.swing.JMenuItem.updateUI(JMenuItem.java:232)
        at javax.swing.JMenuItem.init(JMenuItem.java:194)
        at javax.swing.JMenuItem.<init>(JMenuItem.java:133)
        at javax.swing.JCheckBoxMenuItem.<init>(JCheckBoxMenuItem.java:147)
        at javax.swing.JCheckBoxMenuItem.<init>(JCheckBoxMenuItem.java:105)
        at java2d.Java2Demo.<clinit>(Java2Demo.java:74)
Caused by: java.lang.IllegalArgumentException: 65 incompatible with Text-specific LCD contrast key
        at java.awt.RenderingHints.put(RenderingHints.java:1057)
        at sun.awt.windows.WDesktopProperties.getDesktopAAHints(WDesktopProperties.java:338)
        at sun.awt.windows.WToolkit.getDesktopAAHints(WToolkit.java:956)
        at sun.awt.SunToolkit.getDesktopFontHints(SunToolkit.java:1833)
        at sun.awt.windows.WDesktopProperties.setDesktopAAHints(WDesktopProperties.java:281)
        at sun.awt.windows.WToolkit.initializeDesktopProperties(WToolkit.java:944)
        at java.awt.Toolkit.getDesktopProperty(Toolkit.java:1734)
        at javax.swing.UIManager.<clinit>(UIManager.java:384)
        ... 6 more

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
See description

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
stacktrace

REPRODUCIBILITY :
This bug can be reproduced always.

---------- BEGIN SOURCE ----------
look in de java2demo source
---------- END SOURCE ----------

                                    

Comments
EVALUATION

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". 
> http://www.microsoft.com/windowsxp/downloads/powertoys/xppowertoys.mspx

> 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.
                                     
2006-12-13
EVALUATION

Indeed I could find no way to set to this value except via manual hacking
and running the windows cleartype tuner power toy as soon as you touch anything
it forces it back to 1000. Any value lower than that is nonsensical.
Still its easy for us to check for this in the code that retrieves the value
and constrain to the legal range.
                                     
2006-12-13



Hardware and Software, Engineered to Work Together