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

win.frame.captionButtonWidth desktop property is not updated on system preference change

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Cannot Reproduce
    • Icon: P3 P3
    • None
    • 6
    • client-libs
    • None
    • generic
    • windows_xp

      1. Run Test on windows.
      2. Press "dump properties" button
      3. Change system preferences for the frame height
      (Control Panel -> Display Properties -> Appearance tab -> Advanced button -> Active Title Bar)
      4. Press "dump properties" button again.
      5. Please note that the value for win.frame.captionButtonWidth is not updated.

      6. Close and run the applicaton again.
      7. Press "dump properties" button.
      8. The values are correct now.

      --- Test.java
      import java.awt.Toolkit;
      import java.awt.event.ActionEvent;
      import java.awt.event.ActionListener;

      import javax.swing.JButton;
      import javax.swing.JFrame;

      public class Test {
          public static void main(String[] args) {
              JFrame frame = new JFrame();
              JButton button = new JButton("dump properties");
              button.addActionListener(
                  new ActionListener() {

                      public void actionPerformed(ActionEvent e) {
                          System.out.println("win.frame.captionButtonWidth "
                              + Toolkit.getDefaultToolkit().getDesktopProperty("win.frame.captionButtonWidth")
                              + "\nwin.frame.captionButtonHeight "
                              + Toolkit.getDefaultToolkit().getDesktopProperty("win.frame.captionButtonHeight"));
                      }
                      
                  });

              frame.add(button);
              frame.pack();
              frame.setVisible(true);
          }
      }
      ---
      After running the test some more on XP it seems that changing system
      preferences while the app is running causes
      win.frame.captionButtonWidth to pick up the previous correct value.

      Running test on Vista b5381 looks much worse. win.frame.captionButtonWidth does not seem to pick up the right value ever.
      After the system preference is changed win.frame.captionButtonWidth returns the original value all the time even if the app is restarted.

            dcherepanov Dmitry Cherepanov
            idk Igor Kushnirskiy (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: