This is an example of Physlet. You can download [url=http://webphysics.davidson.edu/physlet_resources/][b]physlet physics library[/b][/url] from their home page.
Please download the following 3 files into the same directory.[url=http://www.phy.ntnu.edu.tw/classes/Optics4_.jar]Optics4_.jar[/url],[url=http://www.phy.ntnu.edu.tw/classes/STools4.jar]STools4.jar[/url],[url=http://www.phy.ntnu.edu.tw/classes/optics_en.rc]optics_en.rc[/url]
And add the following line to your html file

<applet width="600" height="300" code="optics.OpticsApplet.class" archive="Optics4_.jar,STools4.jar" align="baseline" name="Optics"><param name="Resources" value="optics_en.rc"></applet>