问题
As explained on oracle forum, I would like to create a generic controller for my FXML's. (See a this post).
To do this, i would like to "override" FXMLLoader.java
What would i do ? I suppose i have to find the JavaFX original source, modify it and rebuild it as a .jar file.
I found the source code of JavaFX (http://hg.openjdk.java.net/openjfx/8/master/rt/) but i don't understand how to build it and to add it in my Eclipse project.
As i'm starting a new project, I can choose another IDE if necessary.
Thanks for your help
回答1:
FXMLLoader source link
Copy the loader source into your project, rename it, modify it's functionality and use an instance of your custom loader when loading FXML.
You don't need to build the entire OpenJDK or OpenJFX projects to accomplish this, just copy, paste and modify one class.
来源:https://stackoverflow.com/questions/19097943/i-would-like-to-override-fxmlloader-how-can-i-do-that