I have a main JPanel, an inner JPanel and a JScrollPane for the inner JPanel
mainPanel = new JPanel();
innerPanel = new JPanel();
scroll = new JScrollPane(innerPanel);
scroll.setPreferredSize(new Dimension(400,300));
mainPanel.add(scroll);
I'm also adding components dynamically to the inner JPanel
After I add all the components I call revalidate() and repaint() on the inner JPanel
And when I call removeAll() components from the inner JPanel I call revalidate() and repaint() again on the inner JPanel
It works fine but my confusion and question is if I should call revalidate() on the scroll as well, ie:
scroll.getViewport().revalidate();
Thanks for any feedback.