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

Add GridBag classes to AWT layouts

XMLWordPrintable

    • sparc
    • solaris_2.4

      From dstein@marmot Thu Oct 12 18:53:50 1995
      From: dstein@marmot (Doug Stein)
      To: sami.shaio@Eng, vbo@marmot
      Subject: GridBag layout for awt
      Cc: arthur.vanhoff@Eng


      I finished porting GridBag to awt. It sure is easy to port C-code to Java!
      (At least it is if you don't have lots of pointers everywhere).

      I ran some tests and it seems to work fine. The included tar file has
      two classes for gridbag layout (GridBagLayout and GridBagConstraints).
      It also includes 9 silly little applets that lay out bunches of buttons.

      The only new stuff I added that wasn't in the Tk version was handling
      the preferredSize vs. minimumSize stuff. The way I am doing it to
      first try preferredSize for everything. If that doesn't fit, then I
      revert to using minimumSize for everything. Using a combination of
      preferredSize and minimumSize for the case where some components fit
      with preferredSize (but not all components) doesn't seem worth it.

      I'm also wondering if I should use insets instead of pads, since the
      Container class uses insets already. Insets seem more useful than pads,
      so I'll likely change it to use insets.

      I noticed that sometimes the first components to be layed out don't get
      painted until a subsequent refresh is performed. I noticed this
      behavior using some of the other layout classes as well as gridbag, so
      I don't think this bug is specific to gridbag.

      Try it out and let me know what you think. The documentation I've
      included is for the Tk version. Check out the GridBagConstraints class
      and the demos to get an idea of how to use it for awt.

      If you find any bugs, please let me know. I am using the Pre-Beta 1
      release of the Java Developers Kit.


      - Doug

            sshaiosunw Sami Shaio (Inactive)
            ahoffsunw Arthur Hoff (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: