JDK-6369498 : GTKLookAndFeel bug, Antialiasing bug
  • Type: Bug
  • Component: client-libs
  • Sub-Component: javax.swing
  • Affected Version: 6
  • Priority: P3
  • Status: Closed
  • Resolution: Duplicate
  • OS: linux
  • CPU: x86
  • Submitted: 2006-01-06
  • Updated: 2011-03-04
  • Resolved: 2006-09-08
Related Reports
Duplicate :  
Description
FULL PRODUCT VERSION :
java version "1.6.0-rc"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.6.0-rc-b65)
Java HotSpot(TM) Client VM (build 1.6.0-rc-b65, mixed mode)

ADDITIONAL OS VERSION INFORMATION :
Linux 2.6.14

A DESCRIPTION OF THE PROBLEM :
1) we must call UIManager.getInstalledLookAndFeels(); before UIManager.setLookAndFeel("com.sun.java.swing.plaf.gtk.GTKLookAndFeel");

Try the source code below, Executing it gives a java.lang.NullPointerException Exception.

2) if we uncomment UIManager.getInstalledLookAndFeels(); it works.
but with no antialiasing text in the button.

ERROR MESSAGES/STACK TRACES THAT OCCUR :

Exception in thread "main" java.lang.NullPointerException
	at javax.swing.plaf.synth.SynthLookAndFeel$AATextListener.propertyChange(Unknown Source)
	at java.beans.PropertyChangeSupport.firePropertyChange(Unknown Source)
	at java.beans.PropertyChangeSupport.firePropertyChange(Unknown Source)
	at java.beans.PropertyChangeSupport.firePropertyChange(Unknown Source)
	at java.awt.Toolkit.setDesktopProperty(Unknown Source)
	at sun.awt.SunToolkit.fireDesktopFontPropertyChanges(Unknown Source)
	at sun.awt.SunToolkit.setAAFontSettingsCondition(Unknown Source)
	at sun.swing.SwingUtilities2$AATextInfo.getAATextInfo(Unknown Source)
	at com.sun.java.swing.plaf.gtk.GTKLookAndFeel.initComponentDefaults(Unknown Source)
	at com.sun.java.swing.plaf.gtk.GTKLookAndFeel.getDefaults(Unknown Source)
	at javax.swing.UIManager.setLookAndFeel(Unknown Source)
	at javax.swing.UIManager.setLookAndFeel(Unknown Source)
	at Appmain.main(Appmain.java:18)
Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
	at com.sun.java.swing.plaf.gtk.GTKLookAndFeel.initSystemColorDefaults(Unknown Source)
	at com.sun.java.swing.plaf.gtk.GTKLookAndFeel.loadStyles(Unknown Source)
	at com.sun.java.swing.plaf.gtk.GTKLookAndFeel.access$000(Unknown Source)
	at com.sun.java.swing.plaf.gtk.GTKLookAndFeel$WeakPCL$1.run(Unknown Source)
	at java.awt.event.InvocationEvent.dispatch(Unknown Source)
	at java.awt.EventQueue.dispatchEvent(Unknown Source)
	at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
	at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
	at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
	at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
	at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
	at java.awt.EventDispatchThread.run(Unknown Source)


REPRODUCIBILITY :
This bug can be reproduced always.

---------- BEGIN SOURCE ----------
public class Appmain {
	public static void main(String[] args) throws Exception {
//		UIManager.getInstalledLookAndFeels();
		UIManager.setLookAndFeel("com.sun.java.swing.plaf.gtk.GTKLookAndFeel");
	
		
		JFrame frame = new JFrame("Testing");
		JButton bn = new JButton("my label");
		frame.add(bn);
		frame.setSize(300, 100);
		frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
		frame.setVisible(true);
	}
}
---------- END SOURCE ----------

Comments
EVALUATION Disregard my previous comment from 2006-08-18. I am able to reproduce this everytime by displaying to a remote machine (e.g. Linux to Solaris), using JDK 6 b97. Note that the testcase performs the GUI initialization on the main thread, which is illegal. If I modify the testcase to do everything on the EDT, according to recommended practice, then the bug isn't reproducible. However, there might be lots of apps out there that do at least the setLookAndFeel() call on the main thread, so if there's any simple fix here, then we might want to try to fix it for compatibility reasons. It's a tough call, but then again I don't fully understand the cause of the failure yet.
01-09-2006

EVALUATION This is still not reproducible even with 1.6.0-b95. Tried on Ubuntu 6.06 and Solaris 10 and neither showed the problem described above. I'd suggest closing this as not reproducible.
18-08-2006

EVALUATION Looks like non reproducible.
10-01-2006