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

Layout changes in inconsistent manner after resize

    XMLWordPrintable

    Details

    • Subcomponent:
    • Resolved In Build:
      1.0beta
    • CPU:
      sparc
    • OS:
      solaris_2.4
    • Verification:
      Not verified

      Description

      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;
          }
      }

      }

        Attachments

          Activity

            People

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

              Dates

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: