protected void layoutLabel ( ) { Graphics2D gfx = ( Graphics2D ) getGraphics ( ) ; if ( gfx != null ) { // re-layout the label _label . layout ( gfx ) ; gfx . dispose ( ) ; // note that we're no longer dirty _dirty = false ; } }
Called when the label has changed in some meaningful way and we d accordingly like to re - layout the label update our component s size and repaint everything to suit .