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"); invalidate(); validate(); } return super.action(evt, obj); } } // END OF Class LabelText