Dear Pavan Kumar, Thankyou for the reply. It is not working. I don't know what is the problem with that code. When I run it in TextPad, it is showing the image and when i copy the same code and put it in the NetBeans IDE, it is not working. Please help me to find the probelm..