Abel,

Don't think this'll fix your problem, but my understanding of AWT is that you should
be calling the repaint() method, not the update() method.
By calling update I think you are doing your repaint in the current thread, whereas if 
you
call repaint your telling AWT to schedule a paint() at the next possible time.
Which makes it sound like calling update() directly is what you want to do, but I'm not
sure how AWT handles it.
What could fix your problem is a call to Toolkit.sync(), this 'sync' the toolkits 
graphic state.
So try replacing update with:

repaint();
Toolkit.getDefaultToolkit().sync();

Hope this helps
mick :)


You wrote:

> From: Abel Rauch <[EMAIL PROTECTED]>
> To: [EMAIL PROTECTED]
> Date:         Thu, 30 Mar 2000 11:47:58 PST
> Subject:      Re: [JAVA2D] Help! Paint STILL not updating (thread issues)
>
>
> I am trying to display video from a file.
>
> My code is structured like...
>
> while (true) {
>   getHeader()
>   doLotsOfMath();
>   frameNumber++;
>   update(getGraphics());
> }
>
> The update (which calls paint) doesn't paint until all the frames have been
> decoded. This has the effect of only painting the last frame of the file.
> This code works properly in an application but not an applet. (I added a
> main to my applet to test it.)
>
> I have been told that the paint is given a low priority and is collapsed if
> it isn't serviced within a set time.
>
> I will do a search for thread sequencer. Do you know what a paint thread is
> called? My java console shows many threads:
> AWT -event Queue
> AWT windows
> AWT finalizer
> global task manager threads
> task manager notify
> main
> thread applet - app2
> ....
>
> Thanks,
>
> Abel
>
> >From: Michael Thompson <[EMAIL PROTECTED]>
> >To: 'Abel Rauch' <[EMAIL PROTECTED]>
> >Subject: RE: [JAVA2D] Help! Paint STILL not updating (thread issues)
> >Date: Thu, 30 Mar 2000 11:34:08 -0800
> >
> >
> >
> >i don't think i understand your problem, but possibly the following might
> >just work:
> >
> >it almost sounds like your paint thread is getting first priority to
> >execute.  have you tested the use of thread sequencer, which is like a
> >Thread.join(), but is an object that you create that allows other threads
> >to
> >communicate to each other, and sequence themselves if need be.
> >
> >
> >
> >
> >-----Original Message-----
> >From: Abel Rauch [mailto:[EMAIL PROTECTED]]
> >Sent: Thursday, March 30, 2000 10:33 AM
> >To: [EMAIL PROTECTED]
> >Subject: Re: [JAVA2D] Help! Paint STILL not updating (thread issues)
> >
> >
> >Hello all,
> >
> >I should have probably mentioned I am just using awt, no swing so the
> >paintImmediately() is not an option. I don't want to deal with the
> >1.2.2 pugin-in security issues that go with swing.
> >
> >Direct calls to update don't seem to work either. Once again, if I
> >include a main() in my applet I can run it perfectly as an
> >application.
> >
> >I have also tried using:
> >Thread myThread = Thread.currentThread();
> >myThread.setPriority(1);
> >myThread.yield();
> >
> >Does anyone know how I can get ahold of the paint thread? Can I paint
> >from a method that isn't called paint()?
> >
> >I am at wits end. PLEASE help.
> >
> >Thanks,
> >
> >Abel.
> >
> > >From: Abel Rauch <[EMAIL PROTECTED]>
> > >Reply-To: Abel Rauch <[EMAIL PROTECTED]>
> > >To: [EMAIL PROTECTED]
> > >Subject: Paint not updating (thread issues)
> > >Date: Tue, 28 Mar 2000 15:05:33 -0800
> > >
> > >This is a multi-part message in MIME format.
> > >
> > >------=_NextPart_000_0005_01BF98C7.10861600
> > >Content-Type: text/plain;
> > >         charset="iso-8859-1"
> > >Content-Transfer-Encoding: quoted-printable
> > >
> > >Hello all,
> > >
> > >I am building a video decoder / displayer and am running into problems =
> > >repaint() ing with an applet. My routines worked properly in an =
> > >application.=20
> > >
> > >I run through the decoding routine for a frame and then paint it to the =
> > >screen. However, only the last frame paints. This seems to be caused by =
> > >the low_priority the paint thread is given by the applet.
> > >
> > >How can I work around this issue?
> > >
> > >I have tryed direct calls to paint and update and nothing seems to work.
> >=
> > >I am now going to try to create a separate painting thread but don't =
> > >feel too confident about this approach. I also need access to data =
> > >created by the original thread. Has anyone had similar problems and been
> >=
> > >able to resolve this?
> > >
> > >Thanks,
> > >
> > >Abel.
> > >
> > >
> > >------=_NextPart_000_0005_01BF98C7.10861600
> > >Content-Type: text/html;
> > >         charset="iso-8859-1"
> > >Content-Transfer-Encoding: quoted-printable
> > >
> > ><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
> > ><HTML><HEAD>
> > ><META content=3D"text/html; charset=3Diso-8859-1" =
> > >http-equiv=3DContent-Type>
> > ><META content=3D"MSHTML 5.00.2722.2800" name=3DGENERATOR>
> > ><STYLE></STYLE>
> > ></HEAD>
> > ><BODY bgColor=3D#ffffff>
> > ><DIV><FONT face=3DArial size=3D2>Hello all,</FONT></DIV>
> > ><DIV><FONT face=3DArial size=3D2></FONT>&amp;nbsp;</DIV>
> > ><DIV><FONT face=3DArial size=3D2>I am building a video decoder / =
> > >displayer and am=20
> > >running into problems repaint() ing with an applet.&amp;nbsp;My routines =
> > >worked=20
> > >properly in an&amp;nbsp;application. </FONT></DIV>
> > ><DIV>&amp;nbsp;</DIV>
> > ><DIV><FONT face=3DArial size=3D2>I run through the decoding routine for =
> > >a frame and=20
> > >then paint it to the screen. However, only the last frame paints. This =
> > >seems to=20
> > >be caused by the low_priority the paint thread is given by the=20
> > >applet.</FONT></DIV>
> > ><DIV>&amp;nbsp;</DIV>
> > ><DIV><FONT face=3DArial size=3D2>How can I work around this =
> > >issue?</FONT></DIV>
> > ><DIV>&amp;nbsp;</DIV>
> > ><DIV><FONT face=3DArial size=3D2>I have tryed direct calls to paint and =
> > >update and=20
> > >nothing seems to work. I am now going to try to create a separate =
> > >painting=20
> > >thread but don't feel too confident about this approach. I also need =
> > >access to=20
> > >data created by the original thread. Has anyone had similar problems and
> >=
> > >been=20
> > >able to resolve this?</FONT></DIV>
> > ><DIV>&amp;nbsp;</DIV>
> > ><DIV><FONT face=3DArial size=3D2>Thanks,</FONT></DIV>
> > ><DIV>&amp;nbsp;</DIV>
> > ><DIV><FONT face=3DArial size=3D2>Abel.</FONT></DIV>
> > ><DIV>&amp;nbsp;</DIV></BODY></HTML>
> > >
> > >------=_NextPart_000_0005_01BF98C7.10861600--
> > >
> > >===========================================================================
> > >To unsubscribe, send email to [EMAIL PROTECTED] and include in the
> >body
> > >of the message "signoff JAVA2D-INTEREST".  For general help, send email
> >to
> > >[EMAIL PROTECTED] and include in the body of the message "help".
> >
> >______________________________________________________
> >Get Your Private, Free Email at http://www.hotmail.com
> >
> >===========================================================================
> >To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
> >of the message "signoff JAVA2D-INTEREST".  For general help, send email to
> >[EMAIL PROTECTED] and include in the body of the message "help".
>
> ______________________________________________________
> Get Your Private, Free Email at http://www.hotmail.com
>
> ===========================================================================
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
> of the message "signoff JAVA2D-INTEREST".  For general help, send email to
> [EMAIL PROTECTED] and include in the body of the message "help".
>

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA2D-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to