package swing.layout;

import java.awt.Font;

import javax.swing.BoxLayout;
import javax.swing.JButton;
import javax.swing.JFrame;

public class Layout_BoxY {
	private final static Font FONT = new Font("Arial", Font.BOLD, 30);

	public static void main(String[] args) {
		final JFrame okno = new JFrame();
		okno.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		
		BoxLayout layout = new BoxLayout(okno.getContentPane(), BoxLayout.Y_AXIS);
		okno.setLayout(layout);
		
		final JButton button1 = new JButton("A");
		button1.setFont(FONT);
		okno.add(button1);
		final JButton button2 = new JButton("B");
		button2.setFont(FONT);
		okno.add(button2);
		final JButton button3 = new JButton("C");
		button3.setFont(FONT);
		okno.add(button3);
		final JButton button4 = new JButton("D");
		button4.setFont(FONT);
		okno.add(button4);
		
		okno.pack();
		okno.setVisible(true);
	}
}
