@@ -0,0 +1,1241 @@
+%0Aimport java.awt.Dimension;%0Aimport java.awt.FlowLayout;%0A%0Aimport javax.swing.JFrame;%0A%0Aimport com.github.sarxos.webcam.Webcam;%0Aimport com.github.sarxos.webcam.WebcamPanel;%0Aimport com.github.sarxos.webcam.WebcamPanel.DrawMode;%0Aimport com.github.sarxos.webcam.WebcamResolution;%0Aimport com.github.sarxos.webcam.ds.javacv.JavaCvDriver;%0A%0Apublic class WebcamPanelExample %7B%0A%09static %7B%0A%09%09Webcam.setDriver(new JavaCvDriver());%0A%09%7D%0A%0A%09public static void main(String%5B%5D args) throws InterruptedException %7B%0A%09%09final JFrame window = new JFrame(%22JavaCV Capture Example%22);%0A%09%09window.setResizable(true);%0A%09%09window.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);%0A%09%09window.getContentPane().setLayout(new FlowLayout());%0A%0A%09%09//final Dimension resolution = WebcamResolution.VGA.getSize();%0A%0A%09%09for (final Webcam webcam : Webcam.getWebcams()) %7B%0A%09%09%09//webcam.setCustomViewSizes(resolution);%0A%09%09%09//webcam.setViewSize(resolution);%0A%09%09%09webcam.open();%0A%0A%09%09%09final WebcamPanel panel = new WebcamPanel(webcam);%0A%09%09%09panel.setDisplayDebugInfo(true);%0A%09%09%09panel.setFPSDisplayed(true);%0A%09%09%09panel.setDrawMode(DrawMode.FILL);%0A%09%09%09panel.setImageSizeDisplayed(true);%0A%09%09%09//panel.setPreferredSize(resolution);%0A%0A%09%09%09window.getContentPane().add(panel);%0A%09%09%7D%0A%09%09window.pack();%0A%09%09window.setVisible(true);%0A%09%7D%0A%7D

use javacv 1.5.5