public void drawPhotograph( ) { Graphics gra = this.getGraphics( ); if (image != null) { x = 0; y = 0; gra.drawImage(image,x,y,this); } } この場合、graの値がnullとなり、実行時に、NullPointer Exceptionが起こります。その原因は何なのでしょうか、また回避策はどのようにすればよいでしょうか?
↧