import java.awt.*;
import java.awt.event.*;
public class main extends java.applet.Applet implements ActionListener {
Label l;
public void init() {
Button b = new Button("press");
b.addActionListener( this );
add(b);
l = new Label("Foo");
add( l );
}
public void actionPerformed(ActionEvent e ) {
l.setText("This is the really long text");
l.invalidate();
validate();
}
}
|