title: JScrollPane doesn't work/show scroll Bars
body: <p>I have a <code>JFrame</code>, that contains a <code>JPanel</code>, which contains a <code>JScrollPane</code>, that contains another <code>JPanel</code>, with two components (<code>JPanels</code>).
  For some reason, when I use WindowBuilder's preview option to see the frame, the <code>JScrollPane</code> shows the <strong>horizontal</strong> scroll bar, but when I compile and run the app, it doesn't.
  Here is what it looks like: </p>
  
  <p>from preview option:  </p>
  
  <p><img src="https://i.stack.imgur.com/DJbsz.png" alt=""></p>
  
  <p>When it's compiled:</p>
  
  <p><img src="https://i.stack.imgur.com/PsdS8.png" alt="enter image description here"></p>
  
  <p>Here is my code:</p>
  
  <pre><code>package home;
  
  import java.awt.EventQueue;
  
  import javax.swing.JFrame;
  
  import java.awt.SystemColor;
  
  import javax.swing.JPanel;
  import javax.swing.SpringLayout;
  import javax.swing.UIManager;
  
  import net.miginfocom.swing.MigLayout;
  
  import javax.swing.JLabel;
  import javax.swing.SwingConstants;
  
  import java.awt.Component;
  import java.awt.BorderLayout;
  import java.awt.Frame;
  
  import com.jgoodies.forms.layout.FormLayout;
  import com.jgoodies.forms.layout.ColumnSpec;
  import com.jgoodies.forms.layout.RowSpec;
  import com.jgoodies.forms.factories.FormFactory;
  
  import javax.swing.GroupLayout;
  import javax.swing.GroupLayout.Alignment;
  import javax.swing.JButton;
  import javax.swing.LayoutStyle.ComponentPlacement;
  import javax.swing.UnsupportedLookAndFeelException;
  
  import java.awt.Font;
  
  import javax.swing.BoxLayout;
  
  import java.awt.event.ActionListener;
  import java.awt.event.ActionEvent;
  import java.awt.event.WindowAdapter;
  import java.awt.event.WindowEvent;
  import java.awt.Color;
  import java.awt.Dimension;
  import java.io.Serializable;
  import java.util.ArrayList;
  import java.util.List;
  import java.util.Random;
  
  import javax.swing.ImageIcon;
  import javax.swing.JScrollPane;
  import javax.swing.border.EtchedBorder;
  import javax.swing.border.LineBorder;
  import javax.swing.ScrollPaneConstants;
  
  public class AtmManeger implements Serializable  {
  
      private JFrame frmAtmManeger;
      public int NumOfOpenAtmMachines = 0;
      private final AtmManeger frame = this;
      private ArrayList&lt;ATMmachine&gt; ATMs = new ArrayList&lt;ATMmachine&gt;();//Array list of all the ATM machines that were opened
      private AtmAccountDataBase atmDataBase = new AtmAccountDataBase();
      private JLabel contLabel = null;
      /**
       * Launch the application.
       */
      public static void main(String[] args) {
  
          EventQueue.invokeLater(new Runnable() {
              public void run() {
                  try {
                      AtmManeger window = new AtmManeger();
                      window.frmAtmManeger.setVisible(true);
                  } catch (Exception e) {
                      e.printStackTrace();
                  }
              }
          });
  
      }
  
      /**
       * Create the application.
       */
      public AtmManeger getFrame() {
          return this.frame;
      }
      public AtmManeger() {
          initialize();
      }
  
      /**
       * Initialize the contents of the frame.
       */
      private void initialize() {
          try {
              UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
          } catch (ClassNotFoundException e1) {
              // TODO Auto-generated catch block
              e1.printStackTrace();
          } catch (InstantiationException e1) {
              // TODO Auto-generated catch block
              e1.printStackTrace();
          } catch (IllegalAccessException e1) {
              // TODO Auto-generated catch block
              e1.printStackTrace();
          } catch (UnsupportedLookAndFeelException e1) {
              // TODO Auto-generated catch block
              e1.printStackTrace();
          }
          frmAtmManeger = new JFrame();
          frmAtmManeger.setMinimumSize(new Dimension(615, 420));
          frmAtmManeger.getContentPane().setBackground(SystemColor.activeCaption);
          JPanel mainPanel = new JPanel();
          mainPanel.setPreferredSize(new Dimension(10, 10));
          frmAtmManeger.setContentPane(mainPanel);
          JScrollPane scrollPane = new JScrollPane();
          mainPanel.add(scrollPane, BorderLayout.CENTER);
          JPanel subPanel = new JPanel();
          subPanel.setSize(new Dimension(1190, 350));
          subPanel.setBackground(SystemColor.activeCaption);
          subPanel.setPreferredSize(new Dimension(1190, 350));
          scrollPane.setViewportView(subPanel);
          subPanel.setLayout(new MigLayout("", "[50.00%,grow][50.00%,grow]", "[grow]"));
          JPanel panel = new JPanel();
          subPanel.add(panel,"cell 0 0,grow");
          panel.setBorder(null);
          panel.setBackground(SystemColor.textHighlight);
  
          panel.setLayout(new MigLayout("", "[100.00%,grow]", "[71px][13.54%][10.09%][41px][][grow]"));
  
          JPanel panel_1 = new JPanel();
          subPanel.add(panel_1, "cell 1 0,grow");
          frmAtmManeger.setTitle("ATM Maneger");
          frmAtmManeger.setBounds(700, 400, 609, 420);
          frmAtmManeger.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
      }
  }
  </code></pre>
  
  <p>I made another app very similar to this one, only that one inherents <code>JFrame</code>. I couldn't find any difference between this code and the one above. code:</p>
  
  <pre><code>package home;
  
  import java.awt.BorderLayout;
  import java.awt.EventQueue;
  
  import javax.swing.JFrame;
  import javax.swing.JPanel;
  import javax.swing.UIManager;
  import javax.swing.border.EmptyBorder;
  import javax.swing.JScrollPane;
  
  import java.awt.Color;
  import java.awt.FlowLayout;
  
  import net.miginfocom.swing.MigLayout;
  
  import java.awt.Dimension;
  import javax.swing.JLabel;
  import javax.swing.JButton;
  
  public class test02 extends JFrame {
  
      private JPanel contentPane;
  
      /**
       * Launch the application.
       */
      public static void main(String[] args) {
          EventQueue.invokeLater(new Runnable() {
              public void run() {
                  try {
                      test02 frame = new test02();
                      frame.setVisible(true);
                  } catch (Exception e) {
                      e.printStackTrace();
                  }
              }
          });
      }
  
      /**
       * Create the frame.
       */
      public test02() {
          try {
              UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
          } catch (Exception e) {
              // Handle exception
          }
          setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
          setBounds(100, 100, 432, 300);
          contentPane = new JPanel();
          contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
          contentPane.setLayout(new BorderLayout(0, 0));
          setContentPane(contentPane);
  
          JScrollPane scrollPane = new JScrollPane();
          contentPane.add(scrollPane, BorderLayout.CENTER);
  
          JPanel panel = new JPanel();
          panel.setPreferredSize(new Dimension(800, 220));
          panel.setBackground(Color.RED);
          scrollPane.setViewportView(panel);
          panel.setLayout(new MigLayout("", "[50.00%,grow][50.00%,grow]", "[grow]"));
  
          JPanel panel_1 = new JPanel();
          panel.add(panel_1, "cell 0 0,grow");
          panel_1.setLayout(new MigLayout("", "[][][][][][][]", "[][][][][][]"));
  
          JLabel lblNewLabel = new JLabel("New label");
          panel_1.add(lblNewLabel, "cell 2 1");
  
          JButton btnNewButton_1 = new JButton("New button");
          panel_1.add(btnNewButton_1, "cell 3 3");
  
          JButton btnNewButton = new JButton("New button");
          panel_1.add(btnNewButton, "cell 2 5");
  
          JLabel lblNewLabel_1 = new JLabel("New label");
          panel_1.add(lblNewLabel_1, "cell 6 5");
  
          JPanel panel_2 = new JPanel();
          panel.add(panel_2, "cell 1 0,grow");
      }
  
  }
  </code></pre>
  
  <p>So it's probably just a silly mistake, but what is it? </p>