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

Calling Window.pack() under Solaris causes window not to show up; Win95 works

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P4
    • Resolution: Cannot Reproduce
    • Affects Version/s: 1.1.4
    • Fix Version/s: None
    • Component/s: client-libs
    • Labels:
    • Subcomponent:
    • CPU:
      sparc
    • OS:
      solaris_2.5.1

      Description



      Name: tb29552 Date: 12/22/97


      In trying to create a small window to display some
      text in to create a "Tool Tip". I have come across a
      problem under Solaris 2.5.1 w/CDE that did not
      arise when I developed the code originally under
      Windows 95. The bug appears to be the same
      problem that was reported under bug #4024578,
      which has been deemed un-reproducable.

      A note about the code below: A window not using
      pack() is created before one using pack(). If
      the two instantiations are swapped, neither window
      will be displayed. I have also tried it with two
      different Frame parents, and if pack() is called
      in one before the other then all subsequent windows
      will not appear.

      import java.awt.*;

      public class WindowBug extends Window
      {

      public WindowBug(Frame parent, String text, int x, int y, boolean usePack)
      {
      super(parent);
      Label label = new Label(text);
      add("Center", label);

      if(usePack)
      pack();
      else
      {
      setSize(100,100);
      validate();
      }
      setLocation(x, y);
      }


      public static void main(String[] args)
      {
      try {
      Frame f = new Frame("WindowBug");
      f.setSize(300, 300);
      f.show();
      String text1 = "Not using pack()";
      WindowBug t = new WindowBug(f, text1, 110, 130, false);
      t.show();


      String text2 = "Using pack()";
      WindowBug t2 = new WindowBug(f, text2, 110, 220, true);
      t2.show();

      }
      catch(Exception ex) {
      ex.printStackTrace();
      }
      }

      }
      (Review ID: 22329)
      ======================================================================

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned Unassigned
              Reporter:
              tbell Tim Bell
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: