GridPane.
 If a ColumnConstraints object is added for a column in a gridpane, the gridpane
 will use those constraint values when computing the column's width and layout.
 For example, to create a GridPane with 5 columns 100 pixels wide:
     GridPane gridpane = new GridPane();
     for (int i = 0; i < 5; i++) {
         ColumnConstraints column = new ColumnConstraints(100);
         gridpane.getColumnConstraints().add(column);
     }
 
     GridPane gridpane = new GridPane();
     ColumnConstraints col1 = new ColumnConstraints();
     col1.setPercentWidth(25);
     ColumnConstraints col2 = new ColumnConstraints();
     col2.setPercentWidth(50);
     ColumnConstraints col3 = new ColumnConstraints();
     col3.setPercentWidth(25);
     gridpane.getColumnConstraints().addAll(col1,col2,col3);
 - Since:
- JavaFX 2.0
- 
Property SummaryPropertiesTypePropertyDescriptionfinal BooleanPropertyThe horizontal fill policy for the column.final ObjectProperty<HPos>The horizontal alignment for the column.final ObjectProperty<Priority>The horizontal grow priority for the column.final DoublePropertyThe maximum width for the column.final DoublePropertyThe minimum width for the column.final DoublePropertyThe width percentage of the column.final DoublePropertyThe preferred width for the column.
- 
Field SummaryFields declared in class javafx.scene.layout.ConstraintsBaseCONSTRAIN_TO_PREF
- 
Constructor SummaryConstructorsConstructorDescriptionCreate a column constraint object with no properties set.ColumnConstraints(double width) Creates a column constraint object with a fixed width.ColumnConstraints(double minWidth, double prefWidth, double maxWidth) Creates a column constraint object with a fixed size range.ColumnConstraints(double minWidth, double prefWidth, double maxWidth, Priority hgrow, HPos halignment, boolean fillWidth) Creates a column constraint object with a fixed size range, horizontal grow priority, horizonal alignment, and horizontal fill behavior.
- 
Method SummaryModifier and TypeMethodDescriptionfinal BooleanPropertyThe horizontal fill policy for the column.final HPosGets the value of thehalignmentproperty.final PrioritygetHgrow()Gets the value of thehgrowproperty.final doubleGets the value of themaxWidthproperty.final doubleGets the value of theminWidthproperty.final doubleGets the value of thepercentWidthproperty.final doubleGets the value of theprefWidthproperty.final ObjectProperty<HPos>The horizontal alignment for the column.final ObjectProperty<Priority>The horizontal grow priority for the column.final booleanGets the value of thefillWidthproperty.final DoublePropertyThe maximum width for the column.final DoublePropertyThe minimum width for the column.final DoublePropertyThe width percentage of the column.final DoublePropertyThe preferred width for the column.final voidsetFillWidth(boolean value) Sets the value of thefillWidthproperty.final voidsetHalignment(HPos value) Sets the value of thehalignmentproperty.final voidSets the value of thehgrowproperty.final voidsetMaxWidth(double value) Sets the value of themaxWidthproperty.final voidsetMinWidth(double value) Sets the value of theminWidthproperty.final voidsetPercentWidth(double value) Sets the value of thepercentWidthproperty.final voidsetPrefWidth(double value) Sets the value of theprefWidthproperty.toString()Returns a string representation of thisColumnConstraintsobject.Methods declared in class javafx.scene.layout.ConstraintsBaserequestLayout
- 
Property Details- 
minWidthThe minimum width for the column. This property is ignored if percentWidth is set.The default value is USE_COMPUTED_SIZE, which means the minimum width will be computed to be the largest minimum width of the column's content. 
- 
prefWidthThe preferred width for the column. This property is ignored if percentWidth is set.The default value is USE_COMPUTED_SIZE, which means the preferred width will be computed to be the largest preferred width of the column's content. 
- 
maxWidthThe maximum width for the column. This property is ignored if percentWidth is set.The default value is USE_COMPUTED_SIZE, which means the maximum width will be computed to be the smallest maximum width of the column's content. 
- 
percentWidthThe width percentage of the column. If set to a value greater than 0, the column will be resized to this percentage of the gridpane's available width and the other size constraints (minWidth, prefWidth, maxWidth, hgrow) will be ignored. The default value is -1, which means the percentage will be ignored.
- 
hgrowThe horizontal grow priority for the column. If set, the gridpane will use this priority to determine whether the column should be given any additional width if the gridpane is resized larger than its preferred width. This property is ignored if percentWidth is set.This default value is null, which means that the column's grow priority will be derived from largest grow priority set on a content node. - See Also:
 
- 
halignmentThe horizontal alignment for the column. If set, will be the default horizontal alignment for nodes contained within the column.The default value is null, which means the column alignment will fall back to the default halignment set on the gridpane. 
- 
fillWidthThe horizontal fill policy for the column. The gridpane will use this property to determine whether nodes contained within the column should be expanded to fill the column or kept to their preferred widths.The default value is true. 
 
- 
- 
Constructor Details- 
ColumnConstraintspublic ColumnConstraints()Create a column constraint object with no properties set.
- 
ColumnConstraintspublic ColumnConstraints(double width) Creates a column constraint object with a fixed width. This is a convenience for setting the preferred width constraint to the fixed value and the minWidth and maxWidth constraints to the USE_PREF_SIZE flag to ensure the column is always that width.- Parameters:
- width- the width of the column
 
- 
ColumnConstraintspublic ColumnConstraints(double minWidth, double prefWidth, double maxWidth) Creates a column constraint object with a fixed size range. This is a convenience for setting the minimum, preferred, and maximum width constraints.- Parameters:
- minWidth- the minimum width
- prefWidth- the preferred width
- maxWidth- the maximum width
 
- 
ColumnConstraintspublic ColumnConstraints(double minWidth, double prefWidth, double maxWidth, Priority hgrow, HPos halignment, boolean fillWidth) Creates a column constraint object with a fixed size range, horizontal grow priority, horizonal alignment, and horizontal fill behavior.- Parameters:
- minWidth- the minimum width
- prefWidth- the preferred width
- maxWidth- the maximum width
- hgrow- the horizontal grow priority
- halignment- the horizonal alignment
- fillWidth- the horizontal fill behavior
 
 
- 
- 
Method Details- 
setMinWidthpublic final void setMinWidth(double value) Sets the value of theminWidthproperty.- Property description:
- The minimum width for the column.
 This property is ignored if percentWidth is set.
 The default value is USE_COMPUTED_SIZE, which means the minimum width will be computed to be the largest minimum width of the column's content. 
- Parameters:
- value- the value for the- minWidthproperty
- See Also:
 
- 
getMinWidthpublic final double getMinWidth()Gets the value of theminWidthproperty.- Property description:
- The minimum width for the column.
 This property is ignored if percentWidth is set.
 The default value is USE_COMPUTED_SIZE, which means the minimum width will be computed to be the largest minimum width of the column's content. 
- Returns:
- the value of the minWidthproperty
- See Also:
 
- 
minWidthPropertyThe minimum width for the column. This property is ignored if percentWidth is set.The default value is USE_COMPUTED_SIZE, which means the minimum width will be computed to be the largest minimum width of the column's content. - Returns:
- the minWidthproperty
- See Also:
 
- 
setPrefWidthpublic final void setPrefWidth(double value) Sets the value of theprefWidthproperty.- Property description:
- The preferred width for the column.
 This property is ignored if percentWidth is set.
 The default value is USE_COMPUTED_SIZE, which means the preferred width will be computed to be the largest preferred width of the column's content. 
- Parameters:
- value- the value for the- prefWidthproperty
- See Also:
 
- 
getPrefWidthpublic final double getPrefWidth()Gets the value of theprefWidthproperty.- Property description:
- The preferred width for the column.
 This property is ignored if percentWidth is set.
 The default value is USE_COMPUTED_SIZE, which means the preferred width will be computed to be the largest preferred width of the column's content. 
- Returns:
- the value of the prefWidthproperty
- See Also:
 
- 
prefWidthPropertyThe preferred width for the column. This property is ignored if percentWidth is set.The default value is USE_COMPUTED_SIZE, which means the preferred width will be computed to be the largest preferred width of the column's content. - Returns:
- the prefWidthproperty
- See Also:
 
- 
setMaxWidthpublic final void setMaxWidth(double value) Sets the value of themaxWidthproperty.- Property description:
- The maximum width for the column.
 This property is ignored if percentWidth is set.
 The default value is USE_COMPUTED_SIZE, which means the maximum width will be computed to be the smallest maximum width of the column's content. 
- Parameters:
- value- the value for the- maxWidthproperty
- See Also:
 
- 
getMaxWidthpublic final double getMaxWidth()Gets the value of themaxWidthproperty.- Property description:
- The maximum width for the column.
 This property is ignored if percentWidth is set.
 The default value is USE_COMPUTED_SIZE, which means the maximum width will be computed to be the smallest maximum width of the column's content. 
- Returns:
- the value of the maxWidthproperty
- See Also:
 
- 
maxWidthPropertyThe maximum width for the column. This property is ignored if percentWidth is set.The default value is USE_COMPUTED_SIZE, which means the maximum width will be computed to be the smallest maximum width of the column's content. - Returns:
- the maxWidthproperty
- See Also:
 
- 
setPercentWidthpublic final void setPercentWidth(double value) Sets the value of thepercentWidthproperty.- Property description:
- The width percentage of the column. If set to a value greater than 0, the column will be resized to this percentage of the gridpane's available width and the other size constraints (minWidth, prefWidth, maxWidth, hgrow) will be ignored. The default value is -1, which means the percentage will be ignored.
- Parameters:
- value- the value for the- percentWidthproperty
- See Also:
 
- 
getPercentWidthpublic final double getPercentWidth()Gets the value of thepercentWidthproperty.- Property description:
- The width percentage of the column. If set to a value greater than 0, the column will be resized to this percentage of the gridpane's available width and the other size constraints (minWidth, prefWidth, maxWidth, hgrow) will be ignored. The default value is -1, which means the percentage will be ignored.
- Returns:
- the value of the percentWidthproperty
- See Also:
 
- 
percentWidthPropertyThe width percentage of the column. If set to a value greater than 0, the column will be resized to this percentage of the gridpane's available width and the other size constraints (minWidth, prefWidth, maxWidth, hgrow) will be ignored. The default value is -1, which means the percentage will be ignored.- Returns:
- the percentWidthproperty
- See Also:
 
- 
setHgrowSets the value of thehgrowproperty.- Property description:
- The horizontal grow priority for the column.  If set, the gridpane will
 use this priority to determine whether the column should be given any
 additional width if the gridpane is resized larger than its preferred width.
 This property is ignored if percentWidth is set.
 This default value is null, which means that the column's grow priority will be derived from largest grow priority set on a content node. 
- Parameters:
- value- the value for the- hgrowproperty
- See Also:
 
- 
getHgrowGets the value of thehgrowproperty.- Property description:
- The horizontal grow priority for the column.  If set, the gridpane will
 use this priority to determine whether the column should be given any
 additional width if the gridpane is resized larger than its preferred width.
 This property is ignored if percentWidth is set.
 This default value is null, which means that the column's grow priority will be derived from largest grow priority set on a content node. 
- Returns:
- the value of the hgrowproperty
- See Also:
 
- 
hgrowPropertyThe horizontal grow priority for the column. If set, the gridpane will use this priority to determine whether the column should be given any additional width if the gridpane is resized larger than its preferred width. This property is ignored if percentWidth is set.This default value is null, which means that the column's grow priority will be derived from largest grow priority set on a content node. - Returns:
- the hgrowproperty
- See Also:
 
- 
setHalignmentSets the value of thehalignmentproperty.- Property description:
- The horizontal alignment for the column. If set, will be the default
 horizontal alignment for nodes contained within the column.
 The default value is null, which means the column alignment will fall back to the default halignment set on the gridpane. 
- Parameters:
- value- the value for the- halignmentproperty
- See Also:
 
- 
getHalignmentGets the value of thehalignmentproperty.- Property description:
- The horizontal alignment for the column. If set, will be the default
 horizontal alignment for nodes contained within the column.
 The default value is null, which means the column alignment will fall back to the default halignment set on the gridpane. 
- Returns:
- the value of the halignmentproperty
- See Also:
 
- 
halignmentPropertyThe horizontal alignment for the column. If set, will be the default horizontal alignment for nodes contained within the column.The default value is null, which means the column alignment will fall back to the default halignment set on the gridpane. - Returns:
- the halignmentproperty
- See Also:
 
- 
setFillWidthpublic final void setFillWidth(boolean value) Sets the value of thefillWidthproperty.- Property description:
- The horizontal fill policy for the column.  The gridpane will
 use this property to determine whether nodes contained within the column
 should be expanded to fill the column or kept to their preferred widths.
 The default value is true. 
- Parameters:
- value- the value for the- fillWidthproperty
- See Also:
 
- 
isFillWidthpublic final boolean isFillWidth()Gets the value of thefillWidthproperty.- Property description:
- The horizontal fill policy for the column.  The gridpane will
 use this property to determine whether nodes contained within the column
 should be expanded to fill the column or kept to their preferred widths.
 The default value is true. 
- Returns:
- the value of the fillWidthproperty
- See Also:
 
- 
fillWidthPropertyThe horizontal fill policy for the column. The gridpane will use this property to determine whether nodes contained within the column should be expanded to fill the column or kept to their preferred widths.The default value is true. - Returns:
- the fillWidthproperty
- See Also:
 
- 
toStringReturns a string representation of thisColumnConstraintsobject.
 
-