@Override public void dispose() { super.dispose(); if (webCam != null) { webCam.stop(); } }
/** * Creates new form PairThisDeviceDialog * * @throws Exception */ public PairThisDeviceDialog(java.awt.Frame parent) throws Exception { super(parent, true); loadDeviceList(); initComponents(0); setDeviceList(); QRCodeProcessor proc = new QRCodeProcessor(); proc.addSquareCodeListener(this); try { if (camLifeViewPanel instanceof OpenCVWebCam) { webCam = (OpenCVWebCam) camLifeViewPanel; webCam.setImageProcessor(proc); webCam.start(); } } catch (Exception e) { e.printStackTrace(); } setLocationRelativeTo(null); }