[4560] in java-interest

home help back first fref pref prev next nref lref last post

Problems with my ImageObserver from within a thread.

daemon@ATHENA.MIT.EDU (Michael Mehrle)
Sat Jan 6 01:04:26 1996

Date: Fri, 5 Jan 1996 20:14:19 -0700
To: beta@natural.com, java-interest@java.Eng.Sun.COM
From: michael@w3media.com (Michael Mehrle)

Everytime I try to compile this thread (via the Roaster compiler - not the
Roaster), I get this error message:

Error:    Incompatible type. Explicit cast needed to convert ThreadContr to
java/awt/image/ImageObserver
ThreadController.java  line 40

I don't get it, since "ThreadContr" is an applet, hence providing the
ImageObserver needed.

For all the Roaster folks: If I use the javac compiler instead of the
Roaster, it compiles okay, but dumps my system if I try to run it via the
Applet Runner.

Obviously I can't *cast* an applet into an ImageObserver (or can I?), what
should I do?


class ThreadOne extends Thread {
        int i;
        ThreadContr b;
        Graphics g;
        public ThreadOne(ThreadContr a)
        {
                  b=a;
                  i=0;
                  g=b.getGraphics();
         }
         public void run()
         {
                  while(true)
                  {
                  g.drawImage(b.m[i],10,20,b); // This is line 40
                        i++ ;
                        if ( i== 17)
                                i=0;
                 }
         }
}



                  \\///
                 [ o-o ]
____________OOOo___(.)___oOOO_______________

     http://www.w3media.com/w3media
          michael@w3media.com
           Tel. 310.441.9599
           Fax  310.441.5919

"One man's mundane and desperate existence
     is someone else's Technicolor."
            -Strange Days-


-
This message was sent to the java-interest mailing list
Info: send 'help' to java-interest-request@java.sun.com

home help back first fref pref prev next nref lref last post