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

Layout changes in inconsistent manner after resize

XMLWordPrintable

    • 1.0beta
    • sparc
    • solaris_2.4
    • Not verified

      In the following test case, instead of pushing the button, just
      resize the frame slightly, and notice that the components are
      laid out nearer to the top of the frame.

      ////////////////////////////////////////////////////////////////////////////
      //
      // @(#)ChoiceSize.java 1.2 26 Oct 1995 14:53:04
      //
      // Copyright 26 Oct 1995 Sun Microsystems, Inc. All Rights Reserved
      //
      ////////////////////////////////////////////////////////////////////////////

      package test;
      import java.awt.*;

      public class ChoiceSize extends Frame {

      public static void main(String[] args) {
          ChoiceSize w = new ChoiceSize();
          w.init();
      }

      private Panel panel;
      private Button b;
      private Choice choice;

      public void init() {
          setLayout(new FlowLayout());

          choice = new Choice();
          choice.addItem("Eat");
          choice.addItem("Sleep");
          add(choice);

          b = new Button("Push Me");
          add(b);
          resize(300, 100);
          show();
      }

      public boolean action(Event e, Object o) {
          if (e.target==b) {
      choice.addItem("Kowabunga, dudes!");
      return true;
          } else {
      return false;
          }
      }

      }

            sshaiosunw Sami Shaio (Inactive)
            duke J. Duke
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: