Second row of gridbaglayout scrolling out of container
I am trying to achieve a layout similar to that of a carousel. It needs to have images added horizontally with a checkbox field in the second row. I have a panel within a jscrollpane and individual images are added to the panel as labels. Please see screen shot. screenshot When I scroll the pane , the first row containing the images stays well within the panel..but if you notice the second row of checkboxes , it scrolls out of the panel. Here is the code ... JLabel lab1=new JLabel(); for (int ii=0; ii<imageFiles.length; ii++) { GridBagConstraints constraint = new GridBagConstraints(); lab1 =