Re: Self-changing font...



You may also comment repaint() call from componentResized (calls repaint
or update anyway after resizing).

I think better way is to use paintComponent combined with your #2 fix

Thanks for the tips.

paintComponent() is certainly helping.

In the real program, some of the calculations I do on a resize are
moderately expensive. I don't want to do them every repaint. Thats why I
put them in componentResized(). If there is a better place for this sort of
thing, I'm all ears...

I guess what you're saying is that the repaint() call in the
componentResized is redundant. I can leave the size calculations there, but
I don't need the repaint()....

You're also suggesting I ditch the size calculations in that routine, but
that isn't something I want to do.

Rob


.



Relevant Pages

  • Re: Self-changing font...
    ... componentResized is redundant. ... I can leave the size calculations there, ... it redraws with the old size. ... If you force a repaint ...
    (comp.lang.java.gui)
  • Re: Self-changing font...
    ... componentResized is redundant. ... I can leave the size calculations there, ... It looks like the repaint() happens before ... repaint, that would work, but I'm pretty sure it isn't good practice to ...
    (comp.lang.java.gui)