public void changeJoystickConnectState(int joyNum) { JoystickThread jt = null; synchronized (this.joyThreads) { if ((joyNum >= 0) && (joyNum < this.joyThreads.length)) { jt = this.joyThreads[joyNum]; if (jt != null) { try { jt.fireStop(); jt.join(500); } catch (InterruptedException ex) { } this.joyThreads[joyNum] = null; } else { jt = new JoystickThread(this, joyNum, true); this.joyThreads[joyNum] = jt; jt.start(); } updJoystickFrm(joyNum); } } }