问题导入:
JavaFx 在使用TableView的过程中,导入单元格数据出了些问题,下面将TableView导入数据做一总结归纳。
具体步骤
1.FXML中建立TableView视图
<TableView fx:id="ranking_table" prefHeight="447.0" prefWidth="781.0" stylesheets="@../css/fullpackstyling.css" HBox.hgrow="ALWAYS">
<columns>
<TableColumn fx:id="Name" text="姓名" />
<TableColumn fx:id="Department" text="单位" />
<TableColumn fx:id="Age" text="年龄" />
<TableColumn fx:id="Run3km" text="3KM" />
<TableColumn fx:id="Score1" text="分数" />
<TableColumn fx:id="Sit_ups" prefWidth="84.0" text="仰卧起坐" />
<TableColumn fx:id="Score2" prefWidth="46.0" text="分数" />
<TableColumn fx:id="horizontal_bar" text="单杠" />
<TableColumn fx:id="Score3" text="分数" />
<TableColumn fx:id="Serpentine_run" text="蛇形跑" />
<TableColumn fx:id="Score4" text="分数" />
<TableColumn fx:id="TotalScore" text="总分" />
<TableColumn fx:id="Ranking" text="排名" />
</columns>
<columnResizePolicy>