import java.awt.*;
import javax.swing.*;

    // Generate Figure D.5
public class BorderTest extends JFrame
{
    public static void main( String [ ] args )
    {
        JFrame f = new BorderTest( );
        JPanel p = new JPanel( );

        p.setLayout( new BorderLayout( ) );
        p.add( new JButton( "North" ), "North" );
        p.add( new JButton( "East" ), "East" );
        p.add( new JButton( "South" ), "South" );
        p.add( new JButton( "West" ), "West" );
        p.add( new JButton( "Center" ), "Center" );

        Container c = f.getContentPane( );
        c.add( p );

        f.pack( );   // Resize frame to minimum size
        f.show( );   // Display the frame
    }
}