I've got a JScrollPane with a JPanel set as its view. In this JPanel, I have a set of smaller panels layed out in rows. My program allows for the user to remove existing rows or add new rows to the parent JPanel. The problem I'm encountering is that when the user adds a new row, I need to resize the parent JPanel such that all rows are visible, but calling JPanel.setSize(int,int) or JPanel.setSize(new Dimension(int,int)) doesn't seem to do anything to the size of the parent JPanel. Is there anything special that must be done to JPanels that are views for a JScrollPane in order to see changes that are made to it? For example, do I need to call repaint(), do I need to set the view again (i.e. ScrollPane.getViewport().setView(MyParentPanel);). I've tried these already, and I'm wondering if anyone has any other suggestions.