posted 14 years ago
Hi everyone.
I am a beginner, so forgive me if you find me asking any stupid questions.
I was trying to draw an image inside a frame using drawImage() method, but we need a reference variable of type graphics.
To get the reference variabble i used the method getGraphics() of Image class in the following manner:
Image img = new ImageIcon("A.jpg").getImage();
Graphics g = img.getGraphics();
g.drawImage(img,0,0,this);
But I am getting an exception at runTime that graphics is not valid with createImage method?
Please help........