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 29 30 31
| panel = new JPanel();
//panel.setBounds(10, 10, 600, 600);
for ( int i =0; i<SelectPDM.vectClassPDM.size();i++){
JButton JButtonb2 =new JButton(SelectPDM.vectClassPDM.get(i).getNom());
JButtonb2.setBounds(20,k, 150, 25);
JButtonb2.setIcon(new ImageIcon("Images/class.gif"));
panel.add(JButtonb2);
k=k+26;
}
for ( int i =0; i<SelectPDM.vectAssoPDM.size();i++){
JButton JButtonb2 =new JButton(SelectPDM.vectAssoPDM.get(i).getNom());
JButtonb2.setBounds(20,k, 150, 25);
JButtonb2.setIcon(new ImageIcon("Images/asso.png"));
panel.add(JButtonb2);
k=k+26;
}
GridBagLayout gbl_panel = new GridBagLayout();
gbl_panel.columnWidths = new int[]{0};
gbl_panel.rowHeights = new int[]{0};
gbl_panel.columnWeights = new double[]{Double.MIN_VALUE};
gbl_panel.rowWeights = new double[]{Double.MIN_VALUE};
panel.setLayout(gbl_panel);
scrollPane = new JScrollPane(panel);
scrollPane.setBounds(286,300, 368, 346);
scrollPane.validate();
scrollPane.repaint();
scrollPane.setAutoscrolls(true);
add(scrollPane); |
Partager