Explanation:

The ROUTE sets up a connection between the TouchSensor and a routine in the Java program called clicked. So whenever the TouchSensor generates an event the method clicked() is called. Remember the VRML file knows about the existence of clicked because it was declared as an eventIn in the Script node.

We changed the "sensor" from triggering on "isOver" to "isActive" -- this triggers an event when the user clicks the mouse button, as opposed to simply moving the mouse over the object.