TableView 显示一列不存在
TableView shows a column that doesn't exist
我有以下 FXML 代码用于 TableView
两列,但它显示了三列,如图所示。我不明白为什么它会显示三列,我只指定了两列...有什么提示吗?
FXML
<TableView fx:id="table"
GridPane.columnIndex="1"
GridPane.rowIndex="0">
<columns>
<TableColumn fx:id="timeColumn" text="time"/>
<TableColumn fx:id="angleColumn" text="angle"/>
</columns>
</TableView>
我找到了如何根据 table 的大小调整列的大小。只需将其添加到 FXML。
<columnResizePolicy>
<TableView fx:constant="CONSTRAINED_RESIZE_POLICY" />
</columnResizePolicy>
我有以下 FXML 代码用于 TableView
两列,但它显示了三列,如图所示。我不明白为什么它会显示三列,我只指定了两列...有什么提示吗?
FXML
<TableView fx:id="table"
GridPane.columnIndex="1"
GridPane.rowIndex="0">
<columns>
<TableColumn fx:id="timeColumn" text="time"/>
<TableColumn fx:id="angleColumn" text="angle"/>
</columns>
</TableView>
我找到了如何根据 table 的大小调整列的大小。只需将其添加到 FXML。
<columnResizePolicy>
<TableView fx:constant="CONSTRAINED_RESIZE_POLICY" />
</columnResizePolicy>