-
Enhancement
-
Resolution: Won't Fix
-
P4
-
None
-
1.4.2
-
x86
-
windows_2000
Name: rmT116609 Date: 10/23/2003
A DESCRIPTION OF THE REQUEST :
As stated by the Swing release notes for JDK1.4, Box and Box.Filler are now JComponent instead of Component. But the Box.createXXX methods still return Component results, which create the need to add numerous casts to JComponent before using the results.
This is particularly needed when creating helper methods to layout Swing components, for instance to use common rules/constraints when placing JComponents in a GridBagLayout. These methods generally accept a JComponent as a parameter, but can't be called directly with a Box.createVerticalStrust(15) parameter as a JComponent is expected: a cast is needed.
JUSTIFICATION :
JDK1.5 will introduce covariant return types, which should make possible to get methods with JComponent return types.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
In class Box:
staticM-^OÀ»JComponent createRigidArea(DimensionM-^OÀ»d)
and other createXXX() methods.
ACTUAL -
In class Box:
staticM-^OÀ»Component createRigidArea(DimensionM-^OÀ»d)
(Incident Review ID: 215931)
======================================================================