I figured it out, the for loop in my randomInt() method was loading the numbers array with the integers from 0-270 every time I called the randomInt() method, so I moved it out into it's own method...
Type: Posts; User: jollex5
I figured it out, the for loop in my randomInt() method was loading the numbers array with the integers from 0-270 every time I called the randomInt() method, so I moved it out into it's own method...
It has it's own method that creates a random number generator using the java.util.Random class and then uses the nextInt() method to get the next random integer.
Here's the method from my code:
...
Thanks for the advice, by placing some more println statements around, I figured out that it the problem isn't that the JLabel isn't updating, but I think the issue is with the randomInt() method...
I'm writing a program that lists a word taken randomly from an array of words and has a text field next to it. When the user types something in the text field and presses enter, it should perform an...