I have many Jlabel that must be insert into jscrollpane. How can I do this? For example:
JScrollPane scrollPane;
JPanel pan = new JPanel();
JLabel[] labeltitoli= new JLabel[50];
pan.setLayout(null);
scrollPane = new JScrollPane(pan);
scrollPane.setBounds(653, 32, 179, 145);
int cont=50;
int i=0;
for (i=0; i<cont; i++){
labeltitoli[i] = new JLabel(" " + i);
//how can i insert this into Jscrollpane?}
but cont it's not definend ( as my JLabel are extracted from my db). Thank's for answers.