title: MigLayout and vertically centered components
body: <p>I want to center buttons as shown below:</p>
  
  <p><img src="https://i.stack.imgur.com/MU3Lh.png" alt="expected result"></p>
  
  <p>Here is my code:</p>
  
  <pre><code>import java.awt.Dimension;
  import javax.swing.*;
  import net.miginfocom.swing.MigLayout;
  
  public class MigLayoutTest extends JFrame {
  
      public static void main(String[] args) {
  
          JPanel content = new JPanel();
          content.setLayout(new MigLayout("center, wrap, gapy 20"));
  
          JButton buttonA = new JButton("button A");
          buttonA.setPreferredSize(new Dimension(100,30));
          JButton buttonB = new JButton("button B");
          buttonB.setPreferredSize(new Dimension(80,80));
          JButton buttonC = new JButton("button C");
          buttonC.setPreferredSize(new Dimension(300,40));
          JButton buttonD = new JButton("button D");
          buttonD.setPreferredSize(new Dimension(200,60));
  
          content.add(buttonA);
          content.add(buttonB);
          content.add(buttonC);
          content.add(buttonD);
  
          JFrame frame = new JFrame("MigLayout Test");
          frame.setContentPane(content);
          frame.setSize(600, 400);
          frame.setVisible(true);
      }
  
  }
  </code></pre>
  
  <p>Buttons are centered, but not vertically.</p>
  
  <p>Any suggestions? Thanks in advance.</p>