import java.awt.*;
import javax.swing.*;


/**
 * An example that uses a scrollable text area
 *
 * @version 1.0
 * @author  Prof. David Bernstein, James Madison Univeristy
 */
public class ScrollableDriver
{

    /**
     * The entry point of the example
     *
     * @param args   The command line arguments
     */
    public static void main(String[] args)
    {
        Container       contentPane;
        JFrame          frame;        
        JLabel          titleLabel;
        JPanel          southPanel;
        JRadioButton    automobilesCB, planesCB, trainsCB;
	JScrollPane  scrollPane;
        JTextArea       messageArea;

	frame = new JFrame();
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

	contentPane = frame.getContentPane();
	contentPane.setLayout(new BorderLayout());

	titleLabel = new JLabel();
	titleLabel.setText("A Scrolling Example");
	contentPane.add(titleLabel, BorderLayout.NORTH);


	messageArea = new JTextArea(1,1);
	// This is new
	scrollPane = new JScrollPane(messageArea);
	contentPane.add(scrollPane, BorderLayout.CENTER);


	  southPanel = new JPanel();
	  southPanel.setLayout(new FlowLayout());

	  planesCB = new JRadioButton("Planes");
	  southPanel.add(planesCB);
	  

	  trainsCB = new JRadioButton("Trains");
	  southPanel.add(trainsCB);

	  automobilesCB = new JRadioButton("Automobiles");
	  southPanel.add(automobilesCB);

	contentPane.add(southPanel, BorderLayout.SOUTH);
        
	frame.setSize(400,400);
	frame.setVisible(true);

	
    }
}
