got it!
thanks for the tip!

if(Building==true&&theta-thetabuilding>0)return theta-thetabuilding;
else if(Building==true&&theta-thetabuildingleft<0)return theta-thetabuildingleft;
return 0; // time continues

/htdocs/ntnujava/ejsuser/14019/users/sgeducation/lookang/Pendulumweemat01_pkg/Pendulumweemat01.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(1293.4kB):double click downloaded file to run it. (2 times by 2 users) , Download EJS source View EJS source