changes
added F vs t graphs
added  if (t>=tcollision&&t<=tcollision+dt){
F1 = mass1*(vx1-vtemp1)/dt;
F2 = mass2*(vx2-vtemp2)/dt;
totalF = F1+F2;
 }
added different way to make sound
if (elastic==true)
{
 sound=false;
}
else
{
Toolkit.getDefaultToolkit().beep();
//sound = true; // sound produced
//t_onsound = t;
}
added pause and diagram of F1 and F2

enjoy!