Adding Multiple Panels and Single Scroll bar on the JFrame
I need to add multiple panels on the Jframe one after another(Vertically). To visualize the Problem let us take an example. In the website, there are multiple panels on the Frame and in the right most Part of Frame, it has a Scrollbar to view items present at the bottom. But I am confused how I can do this.
JPanel p=new JPanel();
JPanel p1=new JPanel();
JPanel p2=new JPanel();
JPanel p3=new JPanel();
these panels contains different components. and finally added to JFrame which has null Layout.
But dont know which parameter I should pass in JScrollPane
JScrollPane js=new JScrollPane(???);
so that my purpose get solved.
Secondly How I can add ScrollBar to any Panel in the above mentioned.It means two scroll bar on the same Frame;
Best Example to visualize the problem is : See the WebPage that appears on pressing Post New Thread.