title: How to make a vertical line of buttons from the left side of the frame?
body: <p>A frame which includes panels where buttons are located in a column on the left side of the frame:</p>
  
  <p><a href="https://i.stack.imgur.com/IUk4C.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/IUk4C.png" alt="https://i.stack.imgur.com/IUk4C.png"></a></p>
  
  <p>I tried to make this picture in real Java code but failed.</p>
  
  <p>I can't find the right solution for this issue...</p>
  
  <pre><code>    BorderLayout borderLayout = new BorderLayout();
      GridBagLayout gridBagLayout = new GridBagLayout();
      GridLayout gridLayout = new GridLayout();
      CardLayout cardLayout = new CardLayout();
      JPanel panelMain = new JPanel();
      JPanel panelLeft = new JPanel();
      JPanel panelInnerLeft = new JPanel();
      JPanel panelRight = new JPanel();
  
      panelMain.setLayout(borderLayout);
      panelLeft.setLayout(gridBagLayout);
      panelInnerLeft.setLayout(gridLayout);
      panelRight.setLayout(cardLayout);
  
      button1 = new JButton("Button 1");
      button2 = new JButton("Button 2");
      button3 = new JButton("Button 3");
      button4 = new JButton("Button 4");
  
      panelInnerLeft.add(button1,gridLayout);
      panelInnerLeft.add(button2,gridLayout);
      panelInnerLeft.add(button3,gridLayout);
      panelInnerLeft.add(button4,gridLayout);
  
      panelLeft.add(panelInnerLeft);
      panelMain.add(panelLeft);
      panelMain.add(panelRight);
      add(panelMain);
  </code></pre>