I'm trying to print arraylist contents into Jlabel but the problem is that it only shows the last integer I add, if somebody can help me please?
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
for(int i = 0; i < list.size(); i++){
jLabel1.setText(list.toString());
}
}
private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
list = new ArrayList<Integer>();
int a = Integer.parseInt(jTextField1.getText());
list.add(a);
}