void run() { while (shouldRun) { viewer.updateDepth(); if (!viewer.isDrawRGB()) { viewer.updateIR(); } viewer.repaint(); } frame.dispose(); }