Re: getImage exception

Hi Paul,

I believe the problem you encountered is similar to mine,
i.e. you may not call getImage() displayImpl.java directly
via AWT-Event Queue.

You may overcome this problem using the InvokeLater() method
of Java's SwingUtilities.

I avoided the same problem via implementing a method in my display 
manager directly through a direct thread. Someting like this:


class DisplayManager {
   ....
   DisplayImpl display;
   BufferredImage bimg;
   ....
   ....
   public void invokeGetImage()
   {
      // ************************************
      // *  Make a thread to do the job     *
      // ************************************
      Runnable captureImage = new Runnable() {
          public void run() {bimg=display.getImage();}
      };
      Thread t=new Thread(captureImage);
      t.start();
      
      ... wait for a while for thread to finish!...
      if(bimg!=null) { // you have image

        .... // do whatever you want
      }
   }
   ....
}

I hope the above would help.

Cheers

Ng Say Teong.