?
2012-08-10 11:13:42 UTC
JLabel[] labels = new JLabel[items.chemicals.length];
int labelLocX = 10;
int labelLocY = 100;
for(int i = 0; i < labels.length; i++){
labels[i] = new JLabel(items.chemicals[i].getName() + " " + money.format(items.chemicals[i].getPrice()));
labels[i].setBounds(labelLocX, labelLocY, 500,20);
labelLocX =10;
labelLocY +=20;
add(labels[i]);
}
And it displays with :
. Item
. Item
. Item
. Item
Item
^ the last one down a few spaces and to the left. Why?!