-
Bug
-
Resolution: Fixed
-
P2
-
1.1
-
None
-
1.1
-
sparc
-
solaris_2.5.1
-
Not verified
This happened while running against /usr/green3/local.java/NIGHTLY1/jdk1.1beta/solaris/JDK1.1M
The BeanBox crashes during startup with:
java.lang.IllegalArgumentException: cannot add to layout: constraint must be a string
at java.awt.BorderLayout.addLayoutComponent(BorderLayout.java)
at java.awt.Container.addImpl(Container.java)
at java.awt.Container.add(Container.java)
at sun.beanbox.BeanBoxFrame.<init>(BeanBoxFrame.java:32)
at sun.beanbox.Main.main(Main.java:18)
Note that my code is simpy doing an "add(value)" without specifying a
constraint, so a null constraint is getting passed to BorederLayout.
In previous verions of AWT you could insert things in a border layout without having to specify "North", "South" or whatever. It looks like there is
now a check in BorderLayout that a valid constraint is specified.
The BeanBoxFrame happens to only have a single component (the toplevel
beanbox). It never occurred to me to specify a layout constaint in
the "add" and I used to get away with it. (I made the same mistake in
the BeanBox property sheet frame.)
There is a slightly slippery issue here over whether this change in
behaviour is a "bug" or not. I can see that even though I only have
a single component in my frame, I really ought to have to specify the border layou constaint. So if you decide to close this as "not a bug"
that's OK.
But I am a little concerned that I had code that "worked" OK under
JDK 1.0.2 but which now broke under JDK 1.1. It might be better to
handle this by having BorderLayout check for "null" and apply a
default value...
- Graham