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

BorderLayout provides no way to get the constraint for each child

XMLWordPrintable

    • tiger
    • generic
    • generic



      Name: clC74495 Date: 09/11/98


      We are building a SwingSet IDE. Among other things
      the visual editor must allow a user to edit the
      LayoutManager that is attached to a JPanel.
      The BorderLayout's API provides no way to find the
      constraint associated with each child ("North",
      "South", "East", etc.).

      GridBagLayout already has such a thing:
      (getConstaints).

      Without this ability the BorderLayout is clumsy and
      confusing when used in conjunction with an IDE
      supporting a visual editor, since if the user
      wants to edit a Component's contraint we
      can't display the current value.

      Adding a new methods called getConstraint(Component)
      which returned a String would solve this problem.
      (Review ID: 38184)
      ======================================================================

      Name: krC82822 Date: 07/31/2001


      java version "1.3.1"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.1-b24)
      Java HotSpot(TM) Client VM (build 1.3.1-b24, mixed mode)

      It's currently not possible to tell how a given component is constrained
      in a BorderLayout, or what component is at a specific constraint. There
      are cases where this information is crucial. For example, restoring the
      current location of a tool palette in a BorderLayout requires being able
      to tell that the user dragged the palette to another position, and then
      to save the new constraint. This information is locked up in the layout,
      and there doesn't seem to be a practical way to recover it.
      (Review ID: 127797)
      ======================================================================

            leifs Leif Samuelsson (Inactive)
            clucasius Carlos Lucasius (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: