JScrollPane not showing scrollbars when an Array of JPanels are added to it
<p>Im adding an array of JPanels inside a JScrollPane. The array of JPanels are being added to the JScrollPane but the scroll bars just wont show.</p>

<pre><code>public class MyFrame extends JFrame {

    private JPanel contentPane;
    private JPanel panel_1;
    private JScrollPane scrollPane;

    public static void main(String[] args) {
        EventQueue.invokeLater(new Runnable() {
            public void run() {
                try {
                    MyFrame frame = new MyFrame();
                    frame.setVisible(true);
                } catch (Exception e) {
                    e.printStackTrace();
                }
            }
        });
    }

    public MyFrame() {
        setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        setBounds(100, 100, 288, 300);
        contentPane = new JPanel();
        contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
        setContentPane(contentPane);
        contentPane.setLayout(null);

        panel_1 = new JPanel();
        panel_1.setBounds(10, 114, 434, 136);
        panel_1.setLayout(null);

        scrollPane = new JScrollPane(panel_1);
        scrollPane.setBounds(52, 57, 164, 126);
        scrollPane.setBorder(new TitledBorder(UIManager.getBorder("TitledBorder.border"), "Histogram", TitledBorder.LEADING, TitledBorder.TOP, null, Color.BLUE));
        scrollPane.setLayout(new ScrollPaneLayout());
        contentPane.add(scrollPane);

        buildBar();
    }

    JPanel[] barPanel;
    private void buildBar(){
        int x=0,y=22,w=100,h=80,s=10,n=3;   
        barPanel = new JPanel[n];
        for(int i=0; i&lt;n; i++){
            barPanel[i] = new JPanel();
            barPanel[i].setBounds(x, y, w, h);
            barPanel[i].setBackground(new Color(255,0,0));
            panel_1.add(barPanel[i]);
            panel_1.revalidate();
            panel_1.repaint();
            x = x + w + s;
        }
    }
}
</code></pre>

<p>I have been working on it for hours . Maybe there is something that I've missed out.</p>