FileDocCategorySizeDatePackage
Label1.javaAPI DocExample3446Mon Apr 06 18:10:22 BST 1998None

Label1

public class Label1 extends Applet

Fields Summary
TextField
t1
Label
labl1
Label
labl2
Label
labl3
Button
b1
Button
b2
Constructors Summary
Methods Summary
public booleanaction(java.awt.Event evt, java.lang.Object arg)

    if(evt.target.equals(b1))
      labl2.setText("Text set into Label");
    else if(evt.target.equals(b2)) {
      if(labl3.getText().trim().length() == 0)
        labl3.setText("labl3");
      if(labl3.getAlignment() == Label.LEFT)
        labl3.setAlignment(Label.CENTER);
      else if(labl3.getAlignment()==Label.CENTER)
        labl3.setAlignment(Label.RIGHT);
      else if(labl3.getAlignment() == Label.RIGHT)
        labl3.setAlignment(Label.LEFT);
    }
    else 
      return super.action(evt, arg);
    return true;
  
public voidinit()

     
    add(labl1); add(t1);
    add(b1); add(labl2);
    add(b2); add(labl3);