I have a while loop. In the while loop there is a try catch. In the try a get every 2 seconds the still image from an IP camera.
But somethime i get an exception because the code doesn't get all the packets .. Now i want that when i get the exception , that my code retry the try in my code ..
Can you help me ?
while(true){
Image image = null;
try {
String path = "http://10.13.8.14/media/cam0/still.jpg?res=800";
URL url = new URL(path);
image = ImageIO.read(url);
Thread.sleep(2000);
} catch (Exception e) {
JOptionPane.showMessageDialog(null, "image niet in orde");
}
ImageIcon lic = new ImageIcon(image);
label.setIcon(lic);
}