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

XP L&F: Incorrect window placement under some Windows XP themes

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Cannot Reproduce
    • Icon: P5 P5
    • None
    • 5.0, 6
    • client-libs
    • x86
    • windows_2003, windows_xp

      FULL PRODUCT VERSION :
      java version "1.5.0_01"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_01-b08)
      Java HotSpot(TM) Client VM (build 1.5.0_01-b08, mixed mode, sharing)

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

      A DESCRIPTION OF THE PROBLEM :
      When certain Windows XP themes are used, windows placed at (0,0) appear a few pixels lower.

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Install the bluecurve theme for Windows XP from http://www.deviantart.com/view/2465098/
      (You may need to apply a patch that allows the use of unsigned themes, such as the one at http://www.windowsx.cc/download/nw_uxpatcher.zip )

      Run the attached program, which pops up a small frame displaying its current location.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      The frame should appear at the top of the screen, and its location should be reported as (0,0).
      ACTUAL -
      The frame appears five pixels below the top of the screen, even though it claims it is located at (0,0). If the frame is moved to the top of the screen, its y location is reported as negative!

      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      import java.awt.*;
      import java.awt.event.*;
      import javax.swing.*;

      public class t
      {
        public static void main(String[] args)
        {
          try {
            final JFrame f = new JFrame();
            f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            final JLabel l = new JLabel(" ");
            Dimension s = new Dimension(200, l.getPreferredSize().height);
            l.setPreferredSize(s);
            f.addComponentListener(new ComponentListener()
            {
              public void componentMoved(ComponentEvent e)
              {
                setL(l, f);
              }
              public void componentResized(ComponentEvent e)
              {
                setL(l, f);
              }
              public void componentShown(ComponentEvent e)
              {
                setL(l, f);
              }
              public void componentHidden(ComponentEvent e)
              {
                setL(l, f);
              }
            });
            f.getContentPane().add(l);
            f.pack();
            f.setVisible(true);
          } catch (Exception e) {
            e.printStackTrace();
          }
        }

        private static void setL(JLabel l, JFrame f)
        {
          l.setText(f.getLocation().toString());
        }
      }

      ---------- END SOURCE ----------

      CUSTOMER SUBMITTED WORKAROUND :
      Stick to the themes that come with the OS!
      ###@###.### 2005-06-27 11:20:06 GMT

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

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: