试试GridPane的这个方法:
public static void setHgrow(Node child,
Priority value)
Sets the horizontal grow priority for the child when contained by a gridpane.
If set, the gridpane will use the priority to allocate the child additional
horizontal space if the gridpane is resized larger than it's preferred width.
Setting the value to null will remove the constraint.
Parameters:
child - the child of a gridpane
value - the horizontal grow priority for the child
给有无边框 加 width 并且赋值