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

Dialog dismisses automatically, before it can be read

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P3
    • Resolution: Cannot Reproduce
    • Affects Version/s: 1.2.0
    • Fix Version/s: None
    • Component/s: client-libs
    • Subcomponent:
    • CPU:
      sparc
    • OS:
      solaris_2.6

      Description

      When the following test case is run under 1.2beta4 (builds A and B), the
      optiondialog dismisses immediately after it is brought up. This does not
      happen under 1.1.7 (before build A - on 4/20/98). This bug occurs only on
      Solaris - not win32.

      I am running on an Ultra-1 using Solaris 2.6.

      Also, the frame is sized incorrectly - the setSize(int, int) call has
      no effect, and the frame appears at the minimum size. The frame sizes
      correctly when the optiondialog code is removed from the test case.

      Test case
      ---------
      /*
       * CheckColor.java
       */

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

      public class CheckColor {
          OptionDlg option;
          public static void main(String args[]) {
              new CheckColor();
          }

          public CheckColor() {
              Frame f = new Frame("Check Color");
              // Note: setting the Frame Size has no effect when we use
              // the optiondialog stuff. If we comment out the two lines
              // w/ optiondialog stuff, the frame comes up the right size.
              option = new OptionDlg(f);
              f.setSize(400, 200);
              f.pack();
              f.setVisible(true);
              System.out.println("Check - set frame visible");
              option.setVisible(true);
              System.out.println("Check - set option visible");
          }
      }

      class OptionDlg extends Dialog {
          TextField tf1;
          TextField tf2;

          public OptionDlg(Frame f) {
              super(f);
              System.out.println("Option - did super");
              setLayout(new GridLayout(2, 1));
              System.out.println("Option - did grid");
              tf1 = new TextField("1000", 5);
              tf2 = new TextField(5);
              System.out.println("Option - did tfs");
              add(tf1);
              add(tf2);
              System.out.println("Option - did adds");
              pack();
              System.out.println("Option - did pack");
          }
      }

        Attachments

          Activity

            People

            Assignee:
            lbunnisunw Lara Bunni (Inactive)
            Reporter:
            ehawkessunw Eric Hawkes (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: