offScreenImage is null.. 
possiblly your method createImage(300,300) return a null object

解决方案 »

  1.   

    那为什么会出现 null object 呢?
    如何改正啊?
      

  2.   

    这得看一下你在什么容器上createImage,把代码贴一下吧.
      

  3.   

    我上面那段代码是在 init() 事件中,
    没有声明的话,应该是 this ,也就是容器应该是 JFrame ,
    哦,是不是应该这样呢 this.getContentPane().createImage(int, int) ?
    这样会有问题吗?
      

  4.   

    除非你覆盖JFrame里的这个方法,并正确的new一个Image object.
    否则是行不通的. Component的这个方法一般不会帮你new 一个Image object.
      

  5.   

    知道怎么回事了,如果这个component还没有创建,
    那么在这之上创建的Image就会出现空。