-
Bug
-
Resolution: Cannot Reproduce
-
P4
-
None
-
1.0.2
-
sparc
-
solaris_2.5
If you create an awt Checkbox with the constructor that takes no arguments, and after it's been created, set its label with setLabel, the label won't be set correctly.
Here's sample code that demonstrates the problem:
import java.awt.*;
public class BadCheckbox extends Frame
{
public static void main(String args[])
{
BadCheckbox f = new BadCheckbox();
f.pack();
f.show();
f.changelabel();
}
Checkbox goodcheck, badcheck;
public BadCheckbox()
{
super("Bad check box demo");
goodcheck = new Checkbox("Fred");
add("North",goodcheck);
badcheck = new Checkbox();
add("South",badcheck);
}
public void changelabel()
{
goodcheck.setLabel("Good");
badcheck.setLabel("Bad");
}
}
Here's sample code that demonstrates the problem:
import java.awt.*;
public class BadCheckbox extends Frame
{
public static void main(String args[])
{
BadCheckbox f = new BadCheckbox();
f.pack();
f.show();
f.changelabel();
}
Checkbox goodcheck, badcheck;
public BadCheckbox()
{
super("Bad check box demo");
goodcheck = new Checkbox("Fred");
add("North",goodcheck);
badcheck = new Checkbox();
add("South",badcheck);
}
public void changelabel()
{
goodcheck.setLabel("Good");
badcheck.setLabel("Bad");
}
}