Re: Self-changing font...



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()....

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


.



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...
    ... paintComponentis certainly helping. ... In the real program, some of the calculations I do on a resize are ... I don't want to do them every repaint. ...
    (comp.lang.java.gui)
  • Re: JPanel doesnt update fields
    ... may be revalidate and repaint also redundant. ... public void setDisplay(JComponent display) { ...
    (comp.lang.java.gui)