java.lang illegalargumentexception error width 0 and height (0) must be non-zero

I have a form (Java Netbeens) where I easily show the employee data, which worked perfectly, with the employee data with your photo, but when I call the form from D & D Another form, i get this blessed error, i do not know how to fix the problem, i followed up to see where the error was flowing and it's in this line (with asterisks): foto = new ImageIcon (bi); Image img = foto.getImage (); Image newimg = img.getScaledInstance (lblfoto.getWidth (), lblfoto.getHeight (), java.awt.Image.SCALE_SMOOTH); ImageIcon newicon = new ImageIcon (newimg); register[21] = newicon;

please if someone can help me