@DefaultProperty(value="children")
public class Group
A Group will take on( 承担) the collective( 集体的) bounds of its children and is not directly resizable.
Any transform( 改变), effect, or state applied to a Group will be applied to all children of that group. Such transforms and effects will NOT be included in this Group's layout bounds, however if transforms and effects are set directly on children of this Group, those will be included in this Group's layout bounds.
By default, a Group will "auto-size" its managed resizable children to their preferred sizes during the layout pass to ensure that Regions and Controls are sized properly as their state changes. If an application needs to disable this auto-sizing behavior, then it should set autoSizeChildren to false and understand that if the preferred size of the children change, they will not automatically resize (so buyer beware!).
Group Example:
public class Group
extends Parent
A Group will take on( 承担) the collective( 集体的) bounds of its children and is not directly resizable.
Any transform( 改变), effect, or state applied to a Group will be applied to all children of that group. Such transforms and effects will NOT be included in this Group's layout bounds, however if transforms and effects are set directly on children of this Group, those will be included in this Group's layout bounds.
By default, a Group will "auto-size" its managed resizable children to their preferred sizes during the layout pass to ensure that Regions and Controls are sized properly as their state changes. If an application needs to disable this auto-sizing behavior, then it should set autoSizeChildren to false and understand that if the preferred size of the children change, they will not automatically resize (so buyer beware!).
Group Example:
import javafx.scene.*;
import javafx.scene.paint.*;
import javafx.scene.shape.*;
import java.lang.Math;
Group g = new Group();
for (int i = 0; i < 5; i++) {
Rectangle r = new Rectangle();
r.setY(i * 20);
r.setWidth(100);
r.setHeight(10);
r.setFill(Color.RED);
g.getChildren().add(r);
}