-
Enhancement
-
Resolution: Unresolved
-
P5
-
None
-
7
-
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) );
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) );