import javax.swing.*;
public class BoxLayoutEx extends JApplet
{
JButton one, two, three;
public void init( )
{
one = new JButton( "one" );
two = new JButton( "two" );
three = new JButton( "buckle my shoe" );
setLayout( new BoxLayout( getContentPane( ), BoxLayout.Y_AXIS ) );
add( one );
add( two );
add( three );
}
}