If you just want to show trace similar to the applet  at http://www.mste.uiuc.edu/users/Murphy/MovingMan/MovingMan.html

Just add n trace in EJS, and enter x,y property as t and x position.
Let the applet change to [u]play mode[/u] when user starts to [u]drag[/u] the object and enter [u]pause mode[/u] when user [u]release [/u]the mouse.
Then you will get what you want! Check out the following applet (drag the blue dot).

/htdocs/ntnujava/ejsuser/2/users/ntnu/fkh/dragx_pkg/dragx.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(1202.1kB):double click downloaded file to run it. (3 times by 3 users) , Download EJS source (6 times by 5 users) View EJS source