{"action":"created","issue":{"url":"https://api.github.com/repos/sarxos/webcam-capture/issues/293","labels_url":"https://api.github.com/repos/sarxos/webcam-capture/issues/293/labels{/name}","comments_url":"https://api.github.com/repos/sarxos/webcam-capture/issues/293/comments","events_url":"https://api.github.com/repos/sarxos/webcam-capture/issues/293/events","html_url":"https://github.com/sarxos/webcam-capture/issues/293","id":54005155,"number":293,"title":"Why still false and can't run??","user":{"login":"SPRL08","id":10489944,"avatar_url":"https://avatars.githubusercontent.com/u/10489944?v=3","gravatar_id":"","url":"https://api.github.com/users/SPRL08","html_url":"https://github.com/SPRL08","followers_url":"https://api.github.com/users/SPRL08/followers","following_url":"https://api.github.com/users/SPRL08/following{/other_user}","gists_url":"https://api.github.com/users/SPRL08/gists{/gist_id}","starred_url":"https://api.github.com/users/SPRL08/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SPRL08/subscriptions","organizations_url":"https://api.github.com/users/SPRL08/orgs","repos_url":"https://api.github.com/users/SPRL08/repos","events_url":"https://api.github.com/users/SPRL08/events{/privacy}","received_events_url":"https://api.github.com/users/SPRL08/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-01-11T21:13:44Z","updated_at":"2015-01-11T21:20:45Z","closed_at":null,"body":"\r\n\r\nimport java.awt.Dimension;\r\nimport java.awt.FlowLayout;\r\nimport java.awt.image.BufferedImage;\r\nimport java.util.concurrent.Executor;\r\nimport java.util.concurrent.Executors;\r\nimport java.util.concurrent.ThreadFactory;\r\n\r\nimport javax.swing.JFrame;\r\nimport javax.swing.JTextArea;\r\n\r\nimport com.google.zxing.BinaryBitmap;\r\nimport com.google.zxing.LuminanceSource;\r\nimport com.google.zxing.MultiFormatReader;\r\nimport com.google.zxing.NotFoundException;\r\nimport com.google.zxing.Result;\r\nimport com.google.zxing.client.j2se.BufferedImageLuminanceSource;\r\nimport com.google.zxing.common.HybridBinarizer;\r\n\r\n\r\npublic class WebcamQRCodeExample extends JFrame implements Runnable, ThreadFactory {\r\n\r\n\tprivate static final long serialVersionUID = 6441489157408381878L;\r\n\r\n\tprivate final Executor executor = Executors.newSingleThreadExecutor(this);\r\n\r\n\tprivate Webcam webcam = null;      *false\r\n\tprivate WebcamPanel panel = null;      *false\r\n\tprivate JTextArea textarea = null;\r\n\r\n\tpublic WebcamQRCodeExample() {\r\n\t\tsuper();\r\n\r\n\t\tsetLayout(new FlowLayout());\r\n\t\tsetTitle(\"Read QR / Bar Code With Webcam\");\r\n\t\tsetDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\r\n\r\n\t\tDimension size = WebcamResolution.QVGA.getSize();     *false\r\n\r\n\t\twebcam = Webcam.getWebcams().get(0);      *false\r\n\t\twebcam.setViewSize(size);\r\n\r\n\t\tpanel = new WebcamPanel(webcam);        *false\r\n\t\tpanel.setPreferredSize(size);\r\n\r\n\t\ttextarea = new JTextArea();\r\n\t\ttextarea.setEditable(false);\r\n\t\ttextarea.setPreferredSize(size);\r\n\r\n\t\tadd(panel);\r\n\t\tadd(textarea);\r\n\r\n\t\tpack();\r\n\t\tsetVisible(true);\r\n\r\n\t\texecutor.execute(this);\r\n\t}\r\n\r\n\t@Override\r\n\tpublic void run() {\r\n\r\n\t\tdo {\r\n\t\t\ttry {\r\n\t\t\t\tThread.sleep(100);\r\n\t\t\t} catch (InterruptedException e) {\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\r\n\t\t\tResult result = null;\r\n\t\t\tBufferedImage image = null;\r\n\r\n\t\t\tif (webcam.isOpen()) {\r\n\r\n\t\t\t\tif ((image = webcam.getImage()) == null) {\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tLuminanceSource source = new BufferedImageLuminanceSource(image);\r\n\t\t\t\tBinaryBitmap bitmap = new BinaryBitmap(new HybridBinarizer(source));\r\n\r\n\t\t\t\ttry {\r\n\t\t\t\t\tresult = new MultiFormatReader().decode(bitmap);       *false\r\n\t\t\t\t} catch (NotFoundException e) {\r\n\t\t\t\t\t// fall thru, it means there is no QR code in image\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif (result != null) {\r\n\t\t\t\ttextarea.setText(result.getText());\r\n\t\t\t}\r\n\r\n\t\t} while (true);\r\n\t}\r\n\r\n\t@Override\r\n\tpublic Thread newThread(Runnable r) {\r\n\t\tThread t = new Thread(r, \"example-runner\");\r\n\t\tt.setDaemon(true);\r\n\t\treturn t;\r\n\t}\r\n\r\n\tpublic static void main(String[] args) {\r\n\t\tnew WebcamQRCodeExample();       *false\r\n\t}\r\n}"},"comment":{"url":"https://api.github.com/repos/sarxos/webcam-capture/issues/comments/69512053","html_url":"https://github.com/sarxos/webcam-capture/issues/293#issuecomment-69512053","issue_url":"https://api.github.com/repos/sarxos/webcam-capture/issues/293","id":69512053,"user":{"login":"SPRL08","id":10489944,"avatar_url":"https://avatars.githubusercontent.com/u/10489944?v=3","gravatar_id":"","url":"https://api.github.com/users/SPRL08","html_url":"https://github.com/SPRL08","followers_url":"https://api.github.com/users/SPRL08/followers","following_url":"https://api.github.com/users/SPRL08/following{/other_user}","gists_url":"https://api.github.com/users/SPRL08/gists{/gist_id}","starred_url":"https://api.github.com/users/SPRL08/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SPRL08/subscriptions","organizations_url":"https://api.github.com/users/SPRL08/orgs","repos_url":"https://api.github.com/users/SPRL08/repos","events_url":"https://api.github.com/users/SPRL08/events{/privacy}","received_events_url":"https://api.github.com/users/SPRL08/received_events","type":"User","site_admin":false},"created_at":"2015-01-11T21:20:45Z","updated_at":"2015-01-11T21:20:45Z","body":"Help me please,,,\r\nI confused with this problem,,"}}