import java.awt.*; 
import javax.swing.*;
import javax.swing.border.LineBorder;
import javax.swing.border.TitledBorder; 

public class FlowLayoutPanelSize { 

	public static void main(String[] args) {
		
		JFrame frame = new JFrame("FlowLayout() JPanel Size | Java Blackboard [107]");
		frame.setLayout(new FlowLayout()); // frame'mimiz FlowLayout kullanacak
		
		LineBorder linedBorder = new LineBorder(Color.blue);
		TitledBorder titledBorder = BorderFactory.createTitledBorder(linedBorder, "Label Baslik");
		JLabel label = new JLabel();
		label.setBorder(titledBorder);
		label.setPreferredSize(new Dimension(100, 100));
		
		JPanel panel0 = new JPanel();
		panel0.setBackground(new Color(200, 230, 12, 255));
		panel0.setBorder(new TitledBorder("istanbul"));
	//	panel0.setSize(200, 200);
		panel0.setPreferredSize(new Dimension(200, 200)); // panel boyutunu istenen ölçüye ayarla
		
		JPanel panel1 = new JPanel();
		panel1.setBackground(new Color(239, 200, 12, 255));
		panel1.setBorder(new TitledBorder("maraş"));
	//	panel1.setSize(300, 100);
		panel1.setPreferredSize(new Dimension(300, 100)); // panel boyutunu istenen ölçüye ayarla
		
		JPanel panel2 = new JPanel();
		panel2.setBackground(new Color(212, 155, 12, 255));
		panel2.setBorder(new TitledBorder("adıyaman"));
	//	panel2.setSize(200, 150);
		panel2.setPreferredSize(new Dimension(200, 150)); // panel boyutunu istenen ölçüye ayarla
		
		JPanel panel3 = new JPanel();
		panel3.setBackground(new Color(187, 112, 12, 255));
		panel3.setBorder(new TitledBorder("malatya"));
	//	panel3.setSize(400, 75);
		panel3.setPreferredSize(new Dimension(400, 75)); // panel boyutunu istenen ölçüye ayarla
		
		JPanel panel4 = new JPanel();
		panel4.setBackground(new Color(255, 177, 12, 255));
		panel4.setBorder(new TitledBorder("hatay"));
	//	panel4.setSize(100, 220);
		panel4.setPreferredSize(new Dimension(100, 220)); // panel boyutunu istenen ölçüye ayarla
				
		frame.add(label);
		frame.add(panel0); 
		frame.add(panel1);
		frame.add(panel2);
		frame.add(panel3);
		frame.add(panel4);

		frame.setSize(750, 450);
		frame.setLocationRelativeTo(null);
		frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		frame.setVisible(true);
	} 

} 
