com.github.sarxos.webcam.WebcamPicker Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of webcam-capture Show documentation
Show all versions of webcam-capture Show documentation
This library allows you to use your PC webcam, IP or network cameras directly from Java. It's compatible with most operating systems (Windows, Linux, MacOS).
The newest version!
package com.github.sarxos.webcam;
import java.util.List;
import javax.swing.JComboBox;
public class WebcamPicker extends JComboBox {
private static final long serialVersionUID = 1L;
private static final WebcamPickerCellRenderer RENDERER = new WebcamPickerCellRenderer();
public WebcamPicker() {
this(Webcam.getWebcams());
}
public WebcamPicker(List webcams) {
super(new WebcamPickerModel(webcams));
setRenderer(RENDERER);
}
public Webcam getSelectedWebcam() {
return (Webcam) getSelectedItem();
}
}