Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-6369498

GTKLookAndFeel bug, Antialiasing bug

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P3 P3
    • None
    • 6
    • client-libs

      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 ----------

            peterz Peter Zhelezniakov
            ndcosta Nelson Dcosta (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: