I am trying to initialize my table in a new scene and this code is making my program crash. Can someone tell me why?
When I press the button to switch to the new scene in scene builder, there is a TableView that I am trying to initialize and when I put this code in the scene won't change and it gives me errors. If I take this code out I can actually switch the scene without crashing. Can anyone tell me what is wrong? Thanks in advance
I have tried taking out this code and everything works fine but obviously I need this to be able to put information into the table.
public void initialize(URL url, ResourceBundle rb) {
//set up the columns in the table
firstNameColumn.setCellValueFactory(new PropertyValueFactory<Person, String>("firstName"));
lastNameColumn.setCellValueFactory(new PropertyValueFactory<Person, String>("lastName"));
birthdayColumn.setCellValueFactory(new PropertyValueFactory<Person, LocalDate>("birthday"));
//load dummy data
tableView.setItems(getPeople());
}
Comments
Post a Comment