LayoutManager Gridbag Constraint

H

Heino

Gast
Hallo,

könnte mir vielleicht einer erklären was mit den Constraint "weightx" und "weighty" gemeint ist. Ich habe zwar schon gegoogelt, bin aber aus den Erklärungen nicht schlau geworden.

Gruß

Heino
 

Michael...

Top Contributor
Diese Constraints bestimmen die Verteilung des "überschüssigen" Freiraums im Layout.
Siehe Doku: GridBagConstraints
weightx

public double weightx

Specifies how to distribute extra horizontal space.

The grid bag layout manager calculates the weight of a column to be the maximum weightx of all the components in a column. If the resulting layout is smaller horizontally than the area it needs to fill, the extra space is distributed to each column in proportion to its weight. A column that has a weight of zero receives no extra space.

If all the weights are zero, all the extra space appears between the grids of the cell and the left and right edges.

The default value of this field is 0. weightx should be a non-negative value.
 

Ähnliche Java Themen

Neue Themen


Oben