I got following controller for my application:
public class Controller {
@FXML
private CustomerPane customerPane;
}
The customerPane is a extended GridPane:
public class CustomerPane extends GridPane {
@FXML
private TableView<Customer> customerTable;
public CustomerPane() {
System.out.println(this.customerTable);
}
}
My *.fmxl looks like (I left out some details):
<?import vm.CustomerPane?>
<CustomerPane fx:id="customerPane" layoutX="316.0" prefHeight="654.0" prefWidth="536.0" style="-fx-background-color: #7C8184;">
<children>
<TableView fx:id="customerTable" editable="true" prefHeight="200.0" prefWidth="461.0" GridPane.columnSpan="2" GridPane.rowIndex="1">
</TableView>
</children>
</CustomerPane>
I got two problems here:
If I save the fmxl-file with a scene builder, it will override the import of my CustomerPane. Why is this the case and how can I fix it?
The
customerTable
leads to null. Why and how can I fix it?