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

Add varags version of the add method of java.awt.Container

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Unresolved
    • Icon: P5 P5
    • None
    • 7
    • client-libs
    • x86
    • windows_xp

      A DESCRIPTION OF THE REQUEST :
      Can we a have an add method on java.awt.Container that uses varagrs?

      Like this:
      public Component add(Component comp, Object ... constraints) ;


      JUSTIFICATION :
      This would allow layout managers to be designed to take a variable number of arguments when adding a component to a container. This could eliminate a special "constraint" object to bind multiple parameters into one add call. This is exemplified by GridBagConstraints.



      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      // I would like to see a system where the following would be possible
      // fictional varargs based layout manager
      component.add(new JList(), location(1,1), NORTHWEST_ANCHOR, vspan(5), hspan(2) );

            dav Andrei Dmitriev (Inactive)
            ryeung Roger Yeung (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Imported:
              Indexed: