//	GridPanel
//	Demonstrates the grids layout manager

import java.awt.*;
import javax.swing.*;

//creates a subclass named GridPanel from JPanel
public class GridPanel extends JPanel
{
	//Sets up a JPanel with buttons

	public GridPanel()		//default constructor
	{
		//creates a new layout named GridLayout
		setLayout (new GridLayout());		//setLayout (new GridLayout(2,3));  will make
																  // 2 rows and 3 columns (default - all on 1 row)

		JButton btn1 = new JButton ("Button 1");	//creates a button instance with "Button 1")
		JButton btn2 = new JButton ("Button 2");
		JButton btn3 = new JButton ("Button 3");
		JButton btn4 = new JButton ("Button 4");
		JButton btn5 = new JButton ("Button 5");

		add(btn1);		//add Button 1 into the GridLayout
		add(btn2);
		add(btn3);
		add(btn4);
		add(btn5);
	}
}
