import java.awt.*;
import javax.swing.*;


/**
 * An example that uses hierarchical layout
 *
 * @version 1.0
 * @author  CS349, James Madison Univeristy
 */
public class HierarchicalLayoutDriver
{

    /**
     * The entry point of the example
     *
     * @param args   The command line arguments
     */
    public static void main(String[] args)
    {
        Container       contentPane;
        JButton         cancelButton, noButton, yesButton;
        JFrame          frame;    
        JLabel          titleLabel;
        JPanel          southPanel;
        JTextArea       textArea;


	frame = new JFrame();
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

	contentPane = frame.getContentPane();

	contentPane.setLayout(new BorderLayout());

	titleLabel = new JLabel();
	titleLabel.setText("An Example of Hierarchical Layout");
	contentPane.add(titleLabel, BorderLayout.NORTH);


	textArea = new JTextArea(40,20);
	contentPane.add(textArea, BorderLayout.CENTER);


	  southPanel = new JPanel();
	  southPanel.setLayout(new FlowLayout());

	  yesButton = new JButton("Yes");
	  southPanel.add(yesButton);
	  

	  noButton = new JButton("No");
	  southPanel.add(noButton);
 
	  cancelButton = new JButton("Cancel");
	  southPanel.add(cancelButton);

	contentPane.add(southPanel, BorderLayout.SOUTH);

        // Make the JFrame as small as necessary
        frame.pack();

	frame.setSize(400,400);
	frame.setVisible(true);
    }
}
