Java-2 – 2016 – Hafta – 4 – 2

java-2-2016-hafta-4-ornek2

 

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

public class panelornegi1
{
	public panelornegi1()
	{
		JFrame jfrm = new JFrame("ornek2");
		jfrm.setSize(200,200);
		jfrm.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		jfrm.setLayout(new FlowLayout());
		
		JPanel jpn = new JPanel();
		jpn.setPreferredSize(new Dimension(200,200));
		
		JPanel jpn1 = new JPanel();
		jpn1.setBorder(BorderFactory.createLineBorder(Color.YELLOW));
		jpn1.setPreferredSize(new Dimension(195,90));
		JPanel jpn2 = new JPanel();
		jpn2.setBorder(BorderFactory.createLineBorder(Color.RED));
		jpn2.setPreferredSize(new Dimension(195,90));
		
		JLabel jlab1= new JLabel("yazi1");			
		JLabel jlab2= new JLabel("yazi2");
		
		jpn1.add(jlab1);
		jpn2.add(jlab2);
		
		jpn.add(jpn1);
		jpn.add(jpn2);
		
		jfrm.add(jpn);
		
		
		jfrm.setVisible(true);
	}

	public static void main(String[] asds)
	{
		new panelornegi1();
	}

}

 

Share