The java applet on this page is a simulation that illustrates time dilation. For this illustration two clocks are needed. The two clocks are made using pairs of mirrors with a photon bouncing between them. In these mirror clocks each bounce by a photon is a clock tic. One of the clocks is placed in a fast moving space ship, while the other one stays stationary. One of the key postulates of special relativity is that the speed of light is constant regardless of observer. This means that from the point of view of the stationary observer, the photon in the moving clock will have to travel diagonally in order to keep up with the ship. If the speed of the photons in both clocks is the same, and the photon in the moving clock need travel further, the moving clock will produce fewer tics than the stationary one. This is the same as saying that from the point of view of the stationary observer, time flows slower on the space ship.
In the applet there is a counter beneath each pair of mirrors keeping track of the tics of the clock. The slider bar at the bottom of the applet can be used to set how fast the space is moving. The faster the ship moves the more pronounced the time dilation will be.