I want to be able to create JLabels, all different names, with a for loop
ex:
static JLabel[] totalAYearLabelYr = new JLabel[termYears];
So I got 30 JLabels named totalAYearLabelYr, which I'm not sure you can have 30 JLabels named the same thing.
I wanna name them all
totalAYearLabelYr1
totalAYearLabelYr2
totalAYearLabelYr3
totalAYearLabelYr4........as much as the termYears is, etc.
I wanna then setBounds to each Label
for (int i = 0; i < mc.getTermYears(); i++)
for (int v = 295; v <= 1; v += 25)
totalAYearLabelYr[i].setBounds(10, v, 375, 20);
Then add it to the pane (I'm not using a LayoutManager, just setBounds() and pane.add())
for (int i = 0; i < mc.getTermYears(); i++)
pane.add(totalAYearLabelYr[i]);
I'm just assuming errors are because all the JLabels are named the same totalAYearLabelYr name.
I don't want to name them individually like
totalAYearLabelYr1
totalAYearLabelYr2
totalAYearLabelYr3
waaaaayyyy too much code for other things I wanna do, arrays as everyone knows cuts your code to only 2 lines minimum, instead of say 50 lines.