import java.awt.BorderLayout;
import java.awt.Image;
import javax.swing.BoxLayout;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JPanel;
public class optionButton{
public JButton shop;
public JButton exit;
public Image leftButtonIcon;
public Image bg;
public JPanel p;
JPanel p1 = new JPanel();
JPanel p2 = new JPanel();
public optionButton(){
	JFrame contentPane = new JFrame();
	contentPane.setSize(700, 700);
	JButton button = new JButton("Button 1 (PAGE_START)");
	JButton button1 = new JButton("Button 1 (PAGE_START)");
	JButton button2= new JButton("Button 1 (PAGE_START)");
    JPanel mainPanel = new JPanel(); 
   mainPanel.setLayout(new BoxLayout(mainPanel , BoxLayout.Y_AXIS));
   contentPane.add(mainPanel , BorderLayout.CENTER);
public static void main(String[] args) {
	new optionButton();

My three button in the boxlayout is not going to the center when I call the border layout center