http://docs.oracle.com/javase/1.4.2/docs/api/java/lang/Math.html#random()
Quote:
Returns a double value with a positive sign, greater than or equal to 0.0 and less than 1.0.
Casting from double to int is the same as flooring the number.
I strongly suggest writing a randomIntInRange(min, max) or something where both the parameters are
included in the range.
Tip: Make sure you test that function before including it in this project. In other words, make a new project called 'Test' that you just have a main class + main function that you use to write stand alone functions in.
Ok so I did what you said, and it has not fixed anything, my problem was that when I pick a spot in the array that the random number generator has chosen also, the input box closes and it creates an infinite loop