- #1

- 326

- 0

I have a JLabel array of 6 labels.

a random number is generated, its then split into its digits into a 6 element array of integers. now i need to update the Jlabels with the integer array of digits.

my JLabel declaration is

odometer = new JLabel[ 6 ]; // create array for odometer digits

odometerJPanel = new JPanel();

for ( int count = 0; count < odometer.length; count ++)

{

odometer[ count ] = new JLabel( " 0 " );

odometerJPanel.add( odometer[ count ] ); // add odometer to JPanel

}

so initially the labels are all 0.

i have another array filled with the digits i want to put onto the JLabels.

How?

Thanks in advance