[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [cp-patches] FYI: JComponent painting reworked
From: |
Mark Wielaard |
Subject: |
Re: [cp-patches] FYI: JComponent painting reworked |
Date: |
Sun, 25 Sep 2005 19:30:45 +0200 |
Hi Roman,
On Thu, 2005-09-22 at 16:13 +0200, Roman Kennke wrote:
> + /**
> + * Performs normal painting without double buffering.
> + *
> + * @param r the area to be repainted
> + */
> + void paintSimple(Rectangle r)
> + {
> + Graphics g = getGraphics();
> + Graphics g2 = getComponentGraphics(g);
> + paint(g2);
> + g2.dispose();
> + g2.dispose();
> }
You are disposing g2 twice, but not g.
Is there actually a reason to explicitly dispose() of an Graphics
object? Why don't we just let Graphics.finalize() handle it?
Cheers,
Mark
signature.asc
Description: This is a digitally signed message part