multiple JPanels on one Jscrollpane
How to make add many JPanels of different sizes one below other to one Jscrollpane?
I tried something like:
JFrame frame = new JFrame();
JScrollPane scrollPane = new JScrollPane();
for (Class nnn:nnns)
DrawRect drawRect = new DrawRect(nodeList, requests, level); //class that extends JPanel; Preferred size is set dynamically, based on the size of the drawing there
Re: multiple JPanels on one Jscrollpane
You should add a JPanel to the JScrollpane's viewport (not directly to the JScrollPane) to act as a container for the other JPanels. Consider giving this JPanel a BoxLayout so that the other JPanels will be placed one below the other. Most important, read the tutorials on use of scrollpanes and layouts. It will explain all the details.