!7 lib 1008985 // webcam lib 1008987 // bridj lib 1004016 // slf4j api import com.github.sarxos.webcam.*; sclass Example extends JFrame implements Runnable, WebcamPanel.Painter { private Webcam webcam = null; private WebcamPanel.Painter painter = null; *() throws IOException { //webcam = Webcam.getDefault(); webcam = last(webcam.getWebcams()); // Hope this prefers external webcams webcam.setViewSize(WebcamResolution.VGA.getSize()); webcam.open(true); WebcamPanel panel = new WebcamPanel(webcam, false); panel.setPreferredSize(WebcamResolution.VGA.getSize()); panel.setPainter(this); panel.setFPSDisplayed(true); panel.setFPSLimited(true); panel.setFPSLimit(20); //panel.setPainter(this); panel.start(); add(panel); setTitle("Your Live Webcam"); setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); pack(); setLocationRelativeTo(null); setVisible(true); } } p { new Example; }