SetText output from integer array

Joined
Oct 8, 2014
Messages
2
Reaction score
0
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);
}

}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top