B
bugbear
I have a small and pretty simple applet. It's little more than a single
(nested) dialog.
Under IE 6.0.28 with JVM1.5 some sub-components
of the dialog have the wrong sizes (too small).
looking around the structure, all manner of
"strange" numbers have ended up in min/max/pref
size(). 2 identical sub-elements of a Panel
have different sizes from each other!?
The applet works fine with JVM1.4 on the same IE,
and works fine under JVM1.5 with all other browsers.
I only get bad behaviour in the 1 combination.
I can go into more detail, but does
any body recognise anything from this
over-view description?
BugBear
P.S. If anyone cares, I wrote this to dump the size tree.
private void spc(int i) {
for(int ii = 0; ii < i * 2; ii++) {
System.out.print(" ");
}
}
String r(String lab, java.awt.Rectangle rect) {
return lab + "[x=" + rect.x + ",y=" + rect.y +
",width=" + rect.width + ",height=" + rect.height + "]";
}
String d(String lab, java.awt.Dimension d) {
int h = d.height;
int w = d.width;
if(h <= 0 && w <= 0) {
return lab + "[MIN]";
}
if(h >= 32767 && w >= 32767) {
return lab + "[MAX]";
}
return lab + "[h=" + d.height + ",w=" + d.width + "]";
}
void showBounds(int lead, java.awt.Component comp) {
spc(lead);
System.out.println("" + comp.getClass() + ":" + r("",comp.getBounds()));
spc(lead);
System.out.print(d("size",comp.getSize()));
System.out.print(d(",pref_size",comp.getPreferredSize()));
System.out.print(d(",min_size",comp.getMinimumSize()));
System.out.println(d(",max_size",comp.getMaximumSize()));
if(comp instanceof java.awt.Container) {
java.awt.Container cont = (java.awt.Container)comp;
spc(lead);
int c = cont.getComponentCount();
System.out.println("{" + c);
for(int i = 0; i < c; i++) {
showBounds(lead + 1, cont.getComponent(i));
}
spc(lead);
System.out.println("}");
}
}
(nested) dialog.
Under IE 6.0.28 with JVM1.5 some sub-components
of the dialog have the wrong sizes (too small).
looking around the structure, all manner of
"strange" numbers have ended up in min/max/pref
size(). 2 identical sub-elements of a Panel
have different sizes from each other!?
The applet works fine with JVM1.4 on the same IE,
and works fine under JVM1.5 with all other browsers.
I only get bad behaviour in the 1 combination.
I can go into more detail, but does
any body recognise anything from this
over-view description?
BugBear
P.S. If anyone cares, I wrote this to dump the size tree.
private void spc(int i) {
for(int ii = 0; ii < i * 2; ii++) {
System.out.print(" ");
}
}
String r(String lab, java.awt.Rectangle rect) {
return lab + "[x=" + rect.x + ",y=" + rect.y +
",width=" + rect.width + ",height=" + rect.height + "]";
}
String d(String lab, java.awt.Dimension d) {
int h = d.height;
int w = d.width;
if(h <= 0 && w <= 0) {
return lab + "[MIN]";
}
if(h >= 32767 && w >= 32767) {
return lab + "[MAX]";
}
return lab + "[h=" + d.height + ",w=" + d.width + "]";
}
void showBounds(int lead, java.awt.Component comp) {
spc(lead);
System.out.println("" + comp.getClass() + ":" + r("",comp.getBounds()));
spc(lead);
System.out.print(d("size",comp.getSize()));
System.out.print(d(",pref_size",comp.getPreferredSize()));
System.out.print(d(",min_size",comp.getMinimumSize()));
System.out.println(d(",max_size",comp.getMaximumSize()));
if(comp instanceof java.awt.Container) {
java.awt.Container cont = (java.awt.Container)comp;
spc(lead);
int c = cont.getComponentCount();
System.out.println("{" + c);
for(int i = 0; i < c; i++) {
showBounds(lead + 1, cont.getComponent(i));
}
spc(lead);
System.out.println("}");
}
}