You have to getgraphics() for which ever panel you are want to draw into.
Say for eg.
You are adding imagepanel to the
applet which I suppose u would have done this way.
When u draw an image using pgraphics the (0,0) position is wherever the imagepanel starts. And similarly for cgraphics. Hope its clear to u now.