weight

abstract fun SwingModifier.weight(weight: Float, fill: Boolean = true): SwingModifier

Claims weight shares of the width the row has left over once every child that claims none has taken the width it prefers. Two children weighted 1f and 2f take a third and two thirds of it. A child with an explicit maximumSize takes no more than that maximum allows; what it leaves stays empty. With fill the child occupies all the width it is granted; otherwise it occupies as much of that width as it prefers and the row's arrangement places the rest.

Return

this modifier with the width share declared on it.

Parameters

weight

the share claimed, greater than zero

fill

whether the child occupies the whole width it is granted; true by default