Now, I see what you mean.
Here is another version.
Drag velocity arrow to change it's initial velocity.
Click init to reset to initial state.

Click the following image to view simulation.
[eye]

/htdocs/ntnujava/ejsuser/2/users/ntnu/fkh/springfriction2_pkg/springfriction2.propertiesFull screen applet or Problem viewing java?Add http://www.phy.ntnu.edu.tw/ to exception site list
Press the Alt key and the left mouse button to drag the applet off the browser and onto the desktop. This work is licensed under a Creative Commons Attribution 2.5 Taiwan License
Download EJS jar file(959.3kB):double click downloaded file to run it. , Download EJS source View EJS source
[/eye]