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

Windows size and preferred size differ

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Fix
    • Icon: P4 P4
    • None
    • 6u12
    • client-libs
    • None
    • generic
    • generic

      Running the test api/java_awt/Window/index.html#Ctor test Window2003 I noticed that it sometimes fails witn Motif toolkit enabled. This is against JDK6u12. Haven't tried other releases.

      Standalone test (see below) is also failing with Motif if comment every System.* call out. Seem invocation of System*println() affects the time marked for pack() execution or something in native peers. Unfortunately, introducing the output in this test eliminates the failure in my environment.
      This looks like a thread race and possibly may affect XAWT as well though I haven't seen that with XAWT for a long run.
      Most likely that window size and pref.size are different.

      ---------------------------------
      import java.awt.*;
      import java.awt.event.*;

      public class Window2003 {
          public static void main(String s[]) {
              Window win = null;
              try {
                  Frame frame = new Frame("Title");
                  win = new Window(frame);
                  win.pack();

                  System.out.println("size = "+ win.getSize());
                  System.err.println("pref size = "+ win.getPreferredSize());

                  // System.err.println("win is displayable = "+ win.isDisplayable());
                  // System.err.println("frame is displayable = "+ frame.isDisplayable());

                  // System.err.println("win is valid = "+ win.isValid());

                  if(win.getSize().equals(win.getPreferredSize()) &&
                          win.isDisplayable() && frame.isDisplayable() &&
                          win.isValid()) {
                      System.err.println("OKAY");
                      return;
                  }
                  System.err.println("NOT OKAY ");
              } finally {
                  win.dispose();
              }
          }
      }
      ---------------------------------

            dav Andrei Dmitriev (Inactive)
            dav Andrei Dmitriev (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: