Monday, May 4, 2020

Card Layout - Layout Manager

import java.awt.*;
    import java.applet.Applet; 
/* <applet code=Test5.class width=300 height=300></applet>*/
public class Test5 extends java.applet.Applet {
    CardLayout cards = new CardLayout();
     
    public void init() {
        setLayout( cards );
        add( new Button("one"), "one" );
        add( new Button("two"), "two" );
        add( new Button("three"), "three" );
    }
     
    public boolean action( Event e, Object arg) {
        cards.next( this );
        return true;
    }
}

No comments:

Post a Comment