java fx2 使用tableview把資料SHOW出來
fx2要使用tableview SHOW資料出來有幾個地方要注意: 1.宣告tableVIew @FXML // fx:id="table1" private TableView<EmpCard> table1; // Value injected by FXMLLoader 2.宣告有那些COLUMN要SHOW出來 @FXML // fx:id="autoId" private TableColumn<EmpCard, Integer> autoId; // Value injected by FXMLLoader @FXML // fx:id="cardNo" private TableColumn<EmpCard, String> cardNo; // Value injected by FXMLLoader @FXML // fx:id="serNo" private TableColumn<EmpCard, String> serNo; // Value injected by FXMLLoader @FXML // fx:id="empNo" private TableColumn<EmpCard, String> empNo; // Value injected by FXMLLoader @FXML // fx:id="empNo" private TableColumn<EmpCard, String> empName; // Value injected by FXMLLoader 3.設定COLUMN要SHOW的對應欄位 autoId.setCellValueFactory(new PropertyValueFactory<EmpCard, Integer>("autoId")); cardNo.setCellValueFactory(new Propert