i am having problem displaying

m[sub]1[/sub] , m[sub]2[/sub] , m[sub]3[/sub], m[sub]4[/sub] ....... on the mass balls on the newtons cradle applet.

i use

for (int j=0; j < n; j++) {

but the display is m 1 , m 2 , ..... and so on.

i tried looking up the HotEqn - Equation Viewer http://www.atp.ruhr-uni-bochum.de/VCLab/software/HotEqn/HotEqn.html

but the example there seems to be for a static subscript say {v_x} where x is not changing.

now my display subscript changing from 1 to 2 to 3 ..... to 7

any idea what syntax to use?