I am currently building a project which include a couple of buttons, and I am trying to vertically align these buttons in the center of the panel. I am also trying to make them the exact same size (like new Dimension(15, 100)).
For the part where I am trying to center the buttons I have tried to use BoxLayout, which works fine until I try to make the buttons the same size.. I have tried to use
myButton.setSize(new Dimension(15, 100))
myButton.setPreferredSize(new Dimension(15, 100));
myButton.setMinimumSize(new Dimension(15, 100));
and for the BoxLayout part, I am using this code piece
buttonPanel.setLayout(new BoxLayout(buttonPanel, BoxLayout.Y_AXIS));
which works quite well, but it is the centering/size-specification that wont work for me..