how to make a slider time t that allows user to slide to replay simulation

is there any easy way to implement a slider bar t that will allow scrolling back in time like a movie player control for any simulation?

i notice in http://www.phy.ntnu.edu.tw/ntnujava/index.php?topic=188.msg2817#new

in slider property
variable = ts
enabled = _isPaused
on drag = dragt()

under model custom
public void dragt () {
PY1[2]=v1s=v10+a1*ts;
PY2[2]=v2s=v20+a2*ts;
x1s=x10+v10*ts+a1*ts*ts/2;
x2s=x20+v20*ts+a2*ts*ts/2;
PT[2]=PT[3]=ts;
}

this appears to be a way you designed to control the playback controller due to known equations of motion under constant acceleration.

Is there a easy way to do a playback controller for time t for any simulation that it just played ?
i was hoping maybe some library java may have it ;D

thanks!