Re: getImage exception

  Thanks for the pointer...I set up my code as indicated, where a new
thread (created in my event handler) calls a method which then calls
getImage().  However, getImage is stalling.  My first thought was my new
thread was deadlocked with another thread, but the event handler
continues on its merry way and the main program still runs fine.  My new
thread is still around - I list all the active threads and see it on the
list.  Any ideas what to look for in my code that may be causing this?

Thanks...

p


"From: Bill Hibbard " wrote:
> 
> Hi Paul,
> 
> Your Exception is indeed caused by calling getImage() from
> an event handler.  I doubt that using the invokeLater()
> method from SwingUtilities will work.  Your event handler
> needs to construct a 'new Thread' for this, as in the
> captureDialog() method of visad.ss.FancySSCell (at about
> line 700).  Note this method calls BasicSSCell.captureImage()
> which in turn calls DisplayImpl.getImage() and then uses
> the image to build a JPEG file.  Your code would probably
> do something different after the getImage() call.
> 
> I have asked Curtis to upload a new visad.jar longer than
> 3k.
> 
> Cheers,
> Bill
> ----------------------------------------------------------
> Bill Hibbard, SSEC, 1225 W. Dayton St., Madison, WI  53706
> hibbard@xxxxxxxxxxxxxxxxx  608-263-4427  fax: 608-263-6738
> http://www.ssec.wisc.edu/~billh/vis.html
> 
> On Tue, 10 Oct 2000, Paul Gifford wrote:
> 
> >
> > Hello again,
> >
> >   Here's my latest exception:
> >
> > visad.VisADError: cannot call getImage() from Thread: AWT-EventQueue-0
> >         at visad.DisplayImpl.getImage(DisplayImpl.java:1624)
> >
> >
> >   Any thoughts?  I don't get the exception when I run Test50, but I
> > don't see what it is I'm doing differently.  A call to getImage() seems
> > pretty straightforward!
> >
> > Thanks,
> >
> > p
> >
> >
> >
> > ------------------------
> > Paul Gifford, Capt, USAF
> > NOAA/NGDC
> > 325 S Broadway EGC2
> > Boulder CO 80303
> >
> > 303-497-6556 voice
> > 303-497-6513 fax
> >

-- 

------------------------
Paul Gifford, Capt, USAF
NOAA/NGDC
325 S Broadway EGC2
Boulder CO 80303

303-497-6556 voice
303-497-6513 fax


  • 2000 messages navigation, sorted by:
    1. Thread
    2. Subject
    3. Author
    4. Date
    5. ↑ Table Of Contents
  • Search the visad archives: