package javaTutorials.net;
import java.awt.GridLayout;
import javax.swing.JButton;
import javax.swing.JFrame;

public class gridLayoutExample {

	gridLayoutExample(){
			JFrame frame = new JFrame("Flow Layout");
			JButton button,button1, button2, button3,button4;
			button = new JButton("button 1");
			button1 = new JButton("button 2");
			button2 = new JButton("button 3");
			button3 = new JButton("button 4");
			button4 = new JButton("button 5");
			frame.add(button);
			frame.add(button1);
			frame.add(button2);
			frame.add(button3);
			frame.add(button4);
			frame.setLayout(new GridLayout(2,3));
			frame.setSize(300,300);  
			frame.setVisible(true);  
		
		}
		public static void main(String[] args) {
			new gridLayoutExample();

		}

	}



@@ -13,17 +13,16 @@
 Tutorial
-s
 .net;%0D%0Ai

Update gridLayoutExample.java