Layout JavaFXGridPane:展开按钮以填充多个单元格
使用JavaFX的Layout JavaFXGridPane:展开按钮以填充多个单元格,layout,javafx,Layout,Javafx,使用JavaFX的GridPane容器,如何设置按钮(或其他任何东西)以水平展开,直到它填充所有指定的单元格 我使用以下行将按钮添加到我的网格窗格: grid.add(button, 3, 0, 3, 1); 但是按钮的宽度只有文本的宽度,大约2.5个单元格。我希望它完全占据所有3个指定的单元格 你能行 // allow button to grow: button.setMaxWidth(Double.MAX_VALUE); // ask GridPane to make button f
GridPane
容器,如何设置按钮(或其他任何东西)以水平展开,直到它填充所有指定的单元格
我使用以下行将按钮添加到我的网格窗格:
grid.add(button, 3, 0, 3, 1);
但是按钮的宽度只有文本的宽度,大约2.5个单元格。我希望它完全占据所有3个指定的单元格 你能行
// allow button to grow:
button.setMaxWidth(Double.MAX_VALUE);
// ask GridPane to make button fill it's cells:
GridPane.setFillWidth(button, true);
你能行
// allow button to grow:
button.setMaxWidth(Double.MAX_VALUE);
// ask GridPane to make button fill it's cells:
GridPane.setFillWidth(button, true);
这对我不起作用。所有的按钮都是一样大小的。那么你大概还有别的地方做错了。把你自己的问题贴在上面,这对我不起作用。所有的按钮都是一样大小的。那么你大概还有别的地方做错了。把你自己的问题贴在