You can't do this properly. Java does not yet support transparent or irregularly shaped windows. The closest thing you could do is to use the Robot class to capture the desktop areas that your dog or cat was going to walk over and then blit that background content into your rectangular wind that holds the dog/cat image.
Ages ago I posted a small sample of the technique that simply allowed you to drag a circle around the desktop.
There is an issue in Sun's bug database
about the transparent windows and irregular shapes. It's been there for a while now (since Java 1.2) and it still doesn't look like it will make it into Mustang.. so that means it is another two years off at least... (sigh...)