Label not validating in MRJ 4.1

(Apple Bug ID #3123726)

 

    In the applet above, pressing the button changes the text of the Label to be a shorter text.  The label should get smaller.

    If you have any insights, workarounds or comments about this test page please contact Mickey Segal. A listing of  many Macintosh Java bugs with demonstration applets is at this link.

     The source code is shown below and can be downloaded from this link.  Using invalidate, validate and repaint methods for both the container and the Label does not fix the problem.

import java.applet.*;
import java.awt.*;

public class LabelText extends Applet {

Label label;
Button button;

public void init() 
{
    label = new Label("Six words in a yellow label");
    label.setBackground(Color.yellow);
    add(label);
    button = new Button("Change label text");
    add(button);
}

public boolean action(Event evt, Object obj)
{
    if (evt.target == button)
    {
    label.setText("Short text");
    label.invalidate();
// label.validate();
// label.repaint();
// invalidate();
    validate();
// repaint();
    }
    return super.action(evt, obj);
}
} // END OF Class LabelText