Nesne Tabanlı Programlama-2 (Bahar-2016) Hafta-3/2

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


public class yerlesim2 extends JFrame {

	public yerlesim2() {
		
		this.setSize(200,200);
		this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		this.setLayout(new GridLayout(2, 2));
		
		JPanel jpn1 = new JPanel();
		JPanel jpn2 = new JPanel();
		JPanel jpn3 = new JPanel();
		JPanel jpn4 = new JPanel();
		
		this.add(jpn1);
		this.add(jpn2);
		this.add(jpn3);
		this.add(jpn4);
		
		
		JButton jbtn1 = new JButton("Button-1");
		JButton jbtn2 = new JButton("Button-2");
		JButton jbtn3 = new JButton("Button-3");
		JButton jbtn4 = new JButton("Button-4");
		JButton jbtn5 = new JButton("Button-5");


		jpn1.add(jbtn1);		
		jpn1.add(jbtn2);
		jpn2.add(jbtn3);
		jpn3.add(jbtn4);
		jpn4.add(jbtn5);
		
		
		this.setVisible(true);
	}

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		new yerlesim2();

	}

}

 

Share