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

pack()-ing a Frame twice results in incorrect size

    Details

    • Subcomponent:
    • CPU:
      x86
    • OS:
      windows_95

      Description

      orig synopsis: "packing a frame twice stops it resizing"

      Name: diC59631 Date: 12/08/97


      The following code demonstrates a way of making a frame not resize itself. In the following code, comment out one of the two packs which are next to each other. Everything looks cool and the text fits nicely in to the text field. Put it back in and this is no longer the case.

      import java.awt.*;

      public class Testit extends Frame {
      public Testit() {
      TextField tf = new TextField();
      this.add(tf,"Center");
      this.show();
      tf.setText("Testing...lajdshflkjahdsa");
      this.pack();
      this.pack();
      tf.setText("Testing the field one: gibber gibber gibber");
      this.pack();
      }

      public static void main(String args[]) {
      Testit t = new Testit();
      }
      }
      (Review ID: 21428)
      ======================================================================

        Attachments

          Activity

            People

            • Assignee:
              prssunw Prs Prs (Inactive)
              Reporter:
              dindrigo Daniel Indrigo (Inactive)
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Imported:
                Indexed: