Hows it going folks,

First off I'm very new at this. I've read through a basic online beginners tutorial (Java For Beginners - Contents Page for reference)
and I'm attempting to build a simple enough program that simulates the calculations done at a roulette table. I'm a dealer and it's something I think will be handy and develop my skills.

I'm using netbeans 7.2.1 and no idea about jdk but can find out if need be.

Anyway I've got most of the calculations down, a random number is chose for each bet on the winning number (right now the winning number doesnt change, its more of a training exercise for practising my mental calculations) so for example 3 chips on the top left corner, 4 on the top split etc.

Also have a class to calculate how many chips are owed depending on the amount in play (simple arithmetic) and a method to generate a random amount of cash to be taken out of total.

Now all of that I blundered my way through and got to work as I wanted as long as i had a basic layout of 9 labels in a box shape with one in the middle.

I looked up some info about images and went with the label-icon idea, creating a non-opaque background that looks like a roulette table with a panel on top to hold my bets. 9 seperate labels i want to change the icons on, based on the random number generated when i click the generate button.

Right now the relevant code looks like this:


String randomAddy1 = randomAddys[0];
String randomAddy2 = randomAddys[1];
String randomAddy3 = randomAddys[2];
String randomAddy4 = randomAddys[3];
String randomAddy5 = randomAddys[4];
String randomAddy6 = randomAddys[5];
String randomAddy7 = randomAddys[6];
String randomAddy8 = randomAddys[7];
String randomAddy9 = randomAddys[8];

ImageIcon chipIconNW = new ImageIcon(randomAddy1);
lblNW.setIcon(chipIconNW);

ImageIcon chipIconN = new ImageIcon(randomAddy2);
lblN.setIcon(chipIconN);

ImageIcon chipIconNE = new ImageIcon(randomAddy3);
lblNE.setIcon(chipIconNE);

ImageIcon chipIconE = new ImageIcon(randomAddy4);
lblE.setIcon(chipIconE);

ImageIcon chipIconSE = new ImageIcon(randomAddy5);
lblSE.setIcon(chipIconSE);

ImageIcon chipIconS = new ImageIcon(randomAddy6);
lblS.setIcon(chipIconS);

ImageIcon chipIconSW = new ImageIcon(randomAddy7);
lblSW.setIcon(chipIconSW);

ImageIcon chipIconW = new ImageIcon(randomAddy8);
lblW.setIcon(chipIconW);

ImageIcon chipIconC = new ImageIcon(randomAddy9);
lblC.setIcon(chipIconC);


Ok so before this I've taken the random numbers (1-5) corresponding to the different bets that were put in an int[9] and placed the appropriate address
ie. 1chip.jpg if the number is 1 into the string[9].

This code is under the generate button method which initiates most of the calcs in my program.
I wanted the code to stick a picture of a chip with the right number on it where i want it.
Aligning things with gridbaglayout, and when i execute the program the icons do not appear.

I'm sure I'm confusing some pretty basic principles here but I am working without any mentoring or books so im kinda just stumbling round til something works. Thanks in advance for putting it up with me, i can add more code or email it if necessary.

Laz