Drag the block to the left (compress the spring) and let go.


Click the following image to view simulation.
[eye]

ejsuser/2/ejs_springfriction3.jar not found

[/eye]