I have some generic FXML with lots of components but lets say it is a textArea for simplicity.
<?xml version="1.0" encoding="UTF-8"?>
<?import javafx.scene.control.TextArea?>
<TextArea fx:id="test" prefHeight="200.0" prefWidth="200.0" promptText="test data" xmlns="http://javafx.com/javafx/8.0.101" xmlns:fx="http://javafx.com/fxml/1" />
And on this textArea you can see that it has an id of "test".
So my question is can you could reuse this FXML in more than one controller?
My initial thought was through an Generic Controller as seen below:
public abstract class GenericController {
Program program = Program.getInstance();
@FXML TextArea test;
@FXML
abstract void initialize();
abstract void setData();
}
And point the FXML to the GenericController. And then extend it in a more specific controller. But i just get an LoadExceptionError which errors at the fx:controller="sample.Controllers.GenericController".