I am creating a java application that allows me to visualize my webCam in a panel defined for that purpose, but I can not. I'm using bookstores
bridj-0.7.0.jar, slf4j-api-1.7.2.jar, webcam-capture-0.3.12.jar, slf4j-simple-1.7.25.jar
I have created a method to start the webCam:
public void arrancarWebCam(){
webcam = Webcam.getDefault();
webcam.setViewSize(webcam.getViewSizes()[0]);
panelWebCam = new WebcamPanel(webcam, true);
panelWebCam.setPreferredSize(webcam.getViewSize());
panelWebCam.setOpaque(true);
panelWebCam.setBackground(Color.BLACK);
panelWebCam.setBounds(0, 0, 400, 300);
jpPanelFoto.add(panelWebCam);
if (initialized.compareAndSet(false, true)) {
executor.execute(new Runnable() {
@Override
public void run() {
panelWebCam.start();
webcam.open();
}
});
}
}
which I have been mounting getting information from different sources of github and other sites. It's the first time I try to access a webcam and I'm pretty lost with this.
I've been reading and some people have created projects with Maven, I've tried it too, but I do not know how to do a Maven project, I've tried it, but when I have everything correct and without errors in the dependencies, the application it does not do anything, it does not start windows environment or anything.
The method that I mentioned above, I call it from my constructor in the class, it does not give me errors of any kind, previously using the Xarxos libraries, but I have not known how to use it, I would appreciate any help please.
Greetings