Rohit Kedia wrote:
I was able to add child Panels(which consisted of some Components) to a Parent Panel , but problem was that after adding say 10 Panels(which actually depends on my Panel size , which could fit 10 child Panels say) all the newly added child Panels were getting squeezed within that . I had kept that Parent Panel in a ScrollPane but it didnt work.
I tried to increase Panel size every time I add a child Panel still it didn't work.
If you nest components and try out different layout managers, this can be made to work without difficulty. For instance one way (and I'm not saying it's the best way, just that it works), is to place the check box containing JPanels into a GridLayout(0, 1) using JPanel, that is placed BorderLayout.NORTH into a BorderLayout using JPanel, that is placed into a JScrollPane.