Re: [REPOST] java.awt.Image problem
From: Babu Kalakrishnan (k.a.l.a_at_sankya.com)
Date: 12/01/04
- Next message: indo3: "A File as Entity Bean"
- Previous message: bugbear: "Re: how to resize a array?"
- In reply to: MaSTeR: "Re: [REPOST] java.awt.Image problem"
- Next in thread: MaSTeR: "Re: [REPOST] java.awt.Image problem"
- Reply: MaSTeR: "Re: [REPOST] java.awt.Image problem"
- Reply: MaSTeR: "Re: [REPOST] java.awt.Image problem"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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
- Next message: indo3: "A File as Entity Bean"
- Previous message: bugbear: "Re: how to resize a array?"
- In reply to: MaSTeR: "Re: [REPOST] java.awt.Image problem"
- Next in thread: MaSTeR: "Re: [REPOST] java.awt.Image problem"
- Reply: MaSTeR: "Re: [REPOST] java.awt.Image problem"
- Reply: MaSTeR: "Re: [REPOST] java.awt.Image problem"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|