Re: Self-changing font...
- From: Vova Reznik <address@xxxxxxxx>
- Date: Tue, 28 Feb 2006 17:07:39 GMT
Rob McDonald wrote:
I guess what you're saying is that the repaint() call in thebut
componentResized is redundant. I can leave the size calculations there,
I don't need the repaint()....
Trying this, it doesn't work. It looks like the repaint() happens before
the calculations. So, it redraws with the old size. If you force a repaint
at that time, then it looks right.
If there was a way to force an order of the componentResized event and the
repaint(), that would work, but I'm pretty sure it isn't good practice to
rely on such an ordering...
Rob
Unfortunately here isn't any order. It is unknown in that order events arrive into EventQueue.
My experiment showed me that componentResized called before repaint.
That is why I think will be the best to keep your sizing calculation in paintComponent (you force one more repaint. May be it more expensive than calculating).
.
- Follow-Ups:
- Re: Self-changing font...
- From: Rob McDonald
- Re: Self-changing font...
- References:
- Self-changing font...
- From: Rob McDonald
- Re: Self-changing font...
- From: Vova Reznik
- Re: Self-changing font...
- From: Rob McDonald
- Re: Self-changing font...
- From: Rob McDonald
- Self-changing font...
- Prev by Date: Re: Self-changing font...
- Next by Date: Re: Self-changing font...
- Previous by thread: Re: Self-changing font...
- Next by thread: Re: Self-changing font...
- Index(es):
Relevant Pages
|