Unidata - To provide the data services, tools, and cyberinfrastructure leadership that advance Earth system science, enhance educational opportunities, and broaden participation. Unidata
         
  advanced  
 

exception cannot call getImage() from Thread: AWT-EventQueue-1

Hi
I am pretty new to visad and currently exploring its usage for my applications. So far I was able to write some simple applications.

I have run into a problem when I tried to call a visad application through and applet's "submit" button on a web site as in the following format:

private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) { Util.invoke(false,false, new Runnable() {
           public void run() {
           com.app.lt.CreateImage imagePr = new com.app.lt.CreateImage();
               try {
                   BufferedImage myImage =imagePr.plotImage();
               } catch (RemoteException ex) {
                   ex.printStackTrace();
               } catch (VisADException ex) {
                   ex.printStackTrace();
               }
           }
       });
.
.

the exception I get is;

Exception in thread "AWT-EventQueue-1" visad.VisADError: cannot call getImage() from Thread: AWT-EventQueue-1
       at visad.DisplayImpl.getImage(DisplayImpl.java:2630)
       at visad.DisplayImpl.getImage(DisplayImpl.java:2614)
       at com.app.lt.CreateImage.plotImage(CreateImage.java:94)

where line 94 has the following code;
return display.getImage();

and display object is;
DisplayImplJ2D display = new DisplayImplJ2D(" ", 700, 500);

I looked through old e.mails and it seems like this works for everybody else. It works fine if I run the application by itself. Like I said I am a new user and there maybe much easier way to do this but I just don't know yet. any help is greatly appreciated... thanks in advance..
nihat



==============================================================================
To unsubscribe visad, visit:
http://www.unidata.ucar.edu/mailing-list-delete-form.html
==============================================================================


 
 
  Contact Us     Site Map     Search     Terms and Conditions     Privacy Policy     Participation Policy
 
National Science Foundation (NSF) UCAR Community Programs   Unidata is a member of the UCAR Community Programs, is managed by the University Corporation for Atmospheric Research, and is sponsored by the National Science Foundation.
P.O. Box 3000     Boulder, CO 80307-3000 USA     Tel: 303-497-8643     Fax: 303-497-8690