Hello, I have the follwing code below on which I will run a for-loop and give out the value with a setText. But this solution gives out zero. When I change the i for a constant number it works. How can I put out the setText with the i from the for-loop? That means I cannot put out with SetText the sarcLen parameter when I use i, but it works when I use a fixed number instead.
Thanks
Daniel
public static void setLabels(int[] r){
//double peaks = --r[0];
int peaks =2;
//double period = r[1]/peaks;
double [] period = new double [10];
for (int i=0; i < period.length; i++){
period = r/peaks;
Locale.setDefault(Locale.ENGLISH);
DecimalFormat df = new DecimalFormat("###0.000");
sarcLen = period/SarcomereSetup0908.scale;
l3.setText("Sarcomere length(um): "+df.format(sarcLen));
System.out.println(period);
}
}
Thanks
Daniel
public static void setLabels(int[] r){
//double peaks = --r[0];
int peaks =2;
//double period = r[1]/peaks;
double [] period = new double [10];
for (int i=0; i < period.length; i++){
period = r/peaks;
Locale.setDefault(Locale.ENGLISH);
DecimalFormat df = new DecimalFormat("###0.000");
sarcLen = period/SarcomereSetup0908.scale;
l3.setText("Sarcomere length(um): "+df.format(sarcLen));
System.out.println(period);
}
}