Re: [REPOST] java.awt.Image problem

From: Babu Kalakrishnan (k.a.l.a_at_sankya.com)
Date: 12/01/04


Date: Wed, 01 Dec 2004 22:03:50 +0530

MaSTeR wrote:
>>>It does repaint the buffer. Now if there are several threads accessing
>>>without sync the buffer but only one writing would it matter? Even if
>
> the
>
>>>buffer it's being written during a display operation a refresh lateron
>>>should redisplay it correctly...
>>>
>>
>>Yes - as long as a refresh does take place. But if you're triggering a
>>refresh only when a change has taken place, it may never be repainted.
>>
>
> It does, the ticker can be moved back and forth and that forces redrawing
> the buffer. Also iconizing it and refocusing it will repaint.
>

I think I lost you there. Do you mean to say that the display looks
damaged even when you force a refresh by doing the above ?? I'd expect
the display to become trashed as soon as it is updated from the other
thread, and continue to be that way till something else (like the
iconizing / restoring) forces it to refresh itself (at which point it
should display properly). If this is the observed behaviour, that isn't
very surprising at all. Proper synchronization should fix the issue.

>
>>Also I assume you're also ensuring that the paint() method gets called
>>from the update() method. (i.e. if you're overriding update).
>>
>
> I do, the super class implementation clears the screen, causing flickering
> and it was unnecessary since my ticker repaints the whole area.
>

This means that the way you're performing double buffering is broken.
The clearing of the screen is exactly what you *avoid* by using double
buffering.

Of course there is a limit to what one can speculate without seeing the
relevant code.

BK



Relevant Pages

  • Re: Refreshing a Windows Form
    ... What you really need to do is call a method in the parent form that refresh ... refreshing the form is only repaint it, each control repaint itself using ... If the info that they need to display changed, you will have to update them, ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: java applet to application refrshing screen
    ... When I do the same in java applications(using Frame and Panel), ... I am unable to refresh screen. ... to get a chance to service the enqued repaint request. ...
    (comp.lang.java.gui)
  • Re: any recommendations?
    ... I'm modifying the model outside of the EDT and after a few other method calls is when the model is updated with new nodes. ... Then, the model's listeners (to which the JList belongs, too) get notified. ... You call refresh afterwards. ... refreshmodified the ListModel while repaint was active. ...
    (comp.lang.java.programmer)
  • Re: VMR9 Mixer No Display
    ... data being pumped through the graph, ... repaint (by Invalidate and Refresh) but nothing works. ...
    (microsoft.public.win32.programmer.directx.video)
  • Re: Diffrence!!!
    ... Refresh does more than that. ... Me.Repaint in a form causes the *form* to repaint, ... handlers turn the screen back on if you do that. ... for updating calculated controls. ...
    (comp.databases.ms-access)