2016-03-25 8 views
0

Ich habe den folgenden Knoten Schöpfer in meiner Java-Anwendung:Ausgabe mit Tabelleninhalt nicht sichtbar

private Node createWelcomePane() { 
    HBox hbox_accounts = new HBox(); 
    this.getAccounts(); 
    tableAccounts.setPrefSize(500,500); 
    final Label label = new Label("Address Book"); 
    label.setFont(new Font("Arial", 20)); 
    tableAccounts.setEditable(false); 
    TableColumn idCol = new TableColumn("ID"); 
    idCol.setMinWidth(100); 
    idCol.setCellValueFactory(
      new PropertyValueFactory<Account, Integer>("id")); 

    TableColumn typeCol = new TableColumn("Account Type"); 
    typeCol.setMinWidth(100); 
    typeCol.setCellValueFactory(
      new PropertyValueFactory<Account, String>("type")); 

    TableColumn balanceCol = new TableColumn("Balance"); 
    balanceCol.setMinWidth(200); 
    balanceCol.setCellValueFactory(
      new PropertyValueFactory<Account, Float>("balance")); 

    tableAccounts.setItems(accountList); 
    tableAccounts.getColumns().addAll(idCol, typeCol, balanceCol); 
    hbox_accounts.getChildren().add(tableAccounts); 
    hbox_accounts.setAlignment(Pos.CENTER); 
    return hbox_accounts; 
} 

was in Ordnung ist - es schafft Tisch. In der Tabelle sind jedoch keine Daten enthalten (ich kann jedoch auf die ersten 4 Zeilen klicken - weil ich 4 Ganzfelder in meinem Array habe). Gibt es irgendwelche Ideen, warum Daten nicht sichtbar sind?

Antwort

-1

Ich fand heraus, dass ich Getter und Setter zu meiner Account-Klasse hinzufügen musste.

Fall gelöst!