Olá pessoal…estou fazendo uma aplicação que precisa tirar a foto de um cliente.
Mas não estou conseguindo fazer.
Quando eu rodo a aplicação ele dá nullPointerException nesse comando:
di = CaptureDeviceManager.getDevice(str);
segue o codigo:
public void playerstart(){
//COMPONENTE PARA JOGAR A IMAGEM DA WEB CAM
try
{
String str = "vfw:Microsoft WDM Image Capture (Win32):0";
di = CaptureDeviceManager.getDevice(str);
ml = di.getLocator();
player = Manager.createRealizedPlayer(ml);
player.start();
Component comp;
if ((comp = player.getVisualComponent()) != null)
{
panelFoto.add(comp, new GridBagConstraints(0, 0, 1, 5, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0));
}
}
catch (Exception e){
e.printStackTrace();
JOptionPane.showMessageDialog(null, e.getMessage(), "Etiq", JOptionPane.ERROR_MESSAGE);
}
}
Alguem sabe o que pode ser?
estou usando windows 7 64b…
Desde já agradeço!