1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
| JScrollPane scrollPaneGeneral = new JScrollPane(panelFond);
this.getContentPane().add(scrollPaneGeneral);
panelFond.setLayout(new GridBagLayout());
Dimension tailleSpinner = new Dimension(100, 25);
for(int i=0 ; i<NOMBRE_PARAMETRES ; i++)
{
labelParametre[i] = new JLabel("Paramètre " + i + " :");
spinnerParametre[i] = new JSpinner();
spinnerParametre[i].setPreferredSize(tailleSpinner);
constraintsPanelFond.gridx = 0;
constraintsPanelFond.gridy = 2+i;
constraintsPanelFond.gridwidth = 1;
constraintsPanelFond.gridheight = 1;
panelFond.add(labelParametre[i],constraintsPanelFond);
constraintsPanelFond.gridx = 1;
constraintsPanelFond.gridy = 2+i;
constraintsPanelFond.gridwidth = 1;
constraintsPanelFond.gridheight = 1;
panelFond.add(spinnerParametre[i],constraintsPanelFond);
} |
Partager