Ralph Cook wrote:This is pretty much unintelligible.
It took me too long to make out that you have not posted all the code. Your description of what is supposed to happen and what does happen is also a bit obtuse; I could make some guesses about what you mean, but it likely wouldn't help since I can't see the code.
I suggest boiling down what you want to do to a small example -- put the variables in the scope they have to be in the real app, to ensure you can get to them from where you want to, but a couple of labels and buttons and a listener or two should be all you need. And then show us all of it -- where you modify these variables, where you attach the listeners, all of it. Often, in the process of making a small executable example of what you're trying to do, you may even discover the answer yourself.
Michael Dunn wrote:100% agree with Darryl, but if you really want to modify the generated code:
1) add this line to the section // Variables declaration - do not modify
JLabel[] labels;
2) add the indicated line
unless the 'Variables declaration' section is regenerated, you will now be able to access the labels via
labels[number].doSomething();