Adding a set of GroupLayout into JPanel

48 views Asked by At

I have a GroupLayout object

GroupLayout uniquechart[] = new GroupLayout[1000];

That object saves a GroupLayout set, to draw this into JPanelResult I'm doing the following, but I can't put the charts vertically (uniquechart[0] at the top and below uniquechart[1], and so).

for (int m = 0; m < disrup.countInterruptions(); m++) {
    JPanelResult.setLayout(uniquechart[m]);
}

UPDATE 1 Working with JPanels

verticalPanel = new javax.swing.JPanel();

JPanel uniquechart[] = new JPanel[1000];

verticalPanel.setLayout(new FlowLayout());
verticalPanel.setLayout(new BoxLayout(verticalPanel, BoxLayout.Y_AXIS));

for (int m = 0; m < disrup.countInterruptions(); m++) {
    verticalPanel.add(uniquechart[m]);
    jScrollPane4.setViewportView(verticalPanel);
}
0

There are 0 answers