SetActualSize () with Label Component Confusion

If you are extending the UIComponent and adding a Label component to your custom component it seems you need to use setActualSize () for your label to appear. The problem is that I don't know what size the label will have as it depends on the length of the text and the size of the font. Sometimes it works:

label.setActualSize(label.getExplicitOrMeasuredWidth(),
    label.getExplicitOrMeasuredHeight())

      

but not always. I'm not sure why this is.

What's the best way to set the label to its actual size?

thank

0


a source to share


1 answer


Make sure you call setActualSize()

on the label in your UIComponent function updateDisplayList()

. What should have happened. If you select it somewhere else in the validation loop, the child label may not end.



0


a source







All Articles