0
我是JavaFx的新手,我有兩個在FXMl中創建的gridPane,我想做同樣的事情,但在Javafx中。在Javafx中創建gridPane
我想創建一個擴展GridPane類,所以,當我打電話給我的課堂上我將有我在FXML PS相同的結果:如果您使用sceneBuiler,檢查網格線可見,所以你可以看到所有GridPane 謝謝
<GridPane layoutX="138.0" layoutY="72.0">
<children>
<Label text="01" GridPane.columnIndex="1" GridPane.rowIndex="0" />
<Label text="01" GridPane.columnIndex="2" GridPane.rowIndex="0" />
<Label text="01" GridPane.columnIndex="3" GridPane.rowIndex="0" />
<Label text="01" GridPane.columnIndex="4" GridPane.rowIndex="0" />
<Label text="01" GridPane.columnIndex="0" GridPane.rowIndex="0" />
</children>
<columnConstraints>
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="25.0" />
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="25.0" />
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="25.0" />
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="25.0" />
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="25.0" />
</columnConstraints>
<rowConstraints>
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
</rowConstraints>
</GridPane>
<GridPane layoutX="38.0" layoutY="102.0">
<children>
<Label prefWidth="74.0" text="Label" GridPane.columnIndex="0" GridPane.rowIndex="0" />
</children>
<columnConstraints>
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="25.0" />
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="25.0" />
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="25.0" />
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="25.0" />
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="25.0" />
</columnConstraints>
<rowConstraints>
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
</rowConstraints>
</GridPane>
爲什麼你不加載你的fxml來顯示你的gridpane? –
我需要在Javafx中完成它 –