-
Bug
-
Resolution: Unresolved
-
P4
-
None
-
6
-
Cause Known
-
x86
-
windows_xp
This bug came from the 4950972 bug.
The problem is that this:
container.add(component, BorderLayout.NORTH);
is not quite the same as:
container.add(component);
container.getLayout().addLayoutComponent(BorderLayout.NORTH,component);
The latter is what the XMLEncoder creates for the former.
The latter is equivalent to:
container.add(BorderLayout.CENTER,component);
container.getLayout().addLayoutComponent(BorderLayout.NORTH,component);
The problem is that the same component is both the CENTER and the NORTH component in the BorderLayout! BorderLayout assigns bounds to the NORTH first and then to the CENTER; our poor component gets its bounds set twice and lands in the center, with space taken in the east for a phantom version.
The problem is that this:
container.add(component, BorderLayout.NORTH);
is not quite the same as:
container.add(component);
container.getLayout().addLayoutComponent(BorderLayout.NORTH,component);
The latter is what the XMLEncoder creates for the former.
The latter is equivalent to:
container.add(BorderLayout.CENTER,component);
container.getLayout().addLayoutComponent(BorderLayout.NORTH,component);
The problem is that the same component is both the CENTER and the NORTH component in the BorderLayout! BorderLayout assigns bounds to the NORTH first and then to the CENTER; our poor component gets its bounds set twice and lands in the center, with space taken in the east for a phantom version.
- relates to
-
JDK-4950972 LTP: Long-term persistence bugs (swing, Encoder, XMLEncoder)
- Open
-
JDK-6437265 LTP: some Component is missing during xml serializing
- Resolved