package RCX4; import josx.platform.rcx.ProximitySensor; /** *A listener for the Proximity sensor, based on the ProxmitySensor class already *established. */ public class ProxListener extends Thread { ProximitySensor sensor; public ProxListener(ProximitySensor s){ sensor = s; start(); } public void run(){ while (true){ try{ sensor.waitTillNear(0); }catch (InterruptedException ie){} PrettyBoy.b2.detected = true; } } }