-
CSR
-
Resolution: Approved
-
P4
-
None
-
source
-
minimal
-
Minimal risk since this only adds a new constructor. The default constructor still exists and can be used as before.
-
Java API
-
JDK
Summary
Add a new constructor to GridPane
which accepts a hgap
and vgap
value.
Problem
GridPane
is a layout container that is widely used because of its flexibility and constraints.
When creating a layout without the use of FXML, one needs to create a GridPane
and set everything in code.
The hgap
and vgap
values are almost always set after the creation of the GridPane
, as a space between the content is usually desired.
Solution
Add new constructor to the GridPane
class which accepts a hgap
and vgap
value.
This also fits well with other layout container like HBox
, VBox
and FlowPane
which also provide a constructor that accepts the spacing.
Specification
/**
* Creates a {@code GridPane} layout with the given {@link #hgapProperty() hgap} and {@link #vgapProperty() vgap}.
*
* @param hgap the size of the horizontal gaps between columns
* @param vgap the size of the vertical gaps between rows
*
* @since 21
*/
public GridPane(double hgap, double vgap) {
...
}
- csr of
-
JDK-8307208 Add GridPane constructor that accepts hGap and vGap values
- Resolved