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

With GTK L&F JDesktopPane substitutes set desktop manager

XMLWordPrintable

    • b114
    • generic
    • linux
    • Verified

      Testcase
      api/javax_swing/JDesktopPane/descriptions.html#getset[JDesktopPane2002]
      fails on

      Platforms: Linux, Solaris
      JDK: 6, 7
      L&F: -Dswing.defaultlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel

      Methods JDesktopPane.setDesktopManager/getDesktopManager are not consistent under GTK L&F
      Please see the following code sample:
      -----------------------------------------------------------------------------------------
      import javax.swing.*;

      public class TestJDPane {

          public static void main(String[] args) {
              JDesktopPane desktopPane = new JDesktopPane();
              DesktopManager installed = new DefaultDesktopManager();
              desktopPane.setDesktopManager(installed);
              DesktopManager returned = desktopPane.getDesktopManager();
              if (!returned.equals(installed)) {
                  System.out.println("installed = " + installed);
                  System.out.println("returned = " + returned);
              }
          }
      }
      -----------------------------------------------------------------------------------------
      with -Dswing.defaultlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel
      the output will be like the following

      installed = javax.swing.DefaultDesktopManager@82764b
      returned = javax.swing.plaf.synth.SynthDesktopPaneUI$SynthDesktopManager@12452e8

            peterz Peter Zhelezniakov
            dbessono Dmitry Bessonov
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: