0

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

Lionel Père
  • 526
  • 2
  • 5
  • 17

1 Answers1

0

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.

jewelsea
  • 150,031
  • 14
  • 366
  • 406
  • Sorry it doesn't work because I need to access some protected classes and methods. – Lionel Père Oct 02 '13 at 09:48
  • That makes no sense to me Lionel, if you copy the source and modify it, you have complete access to everything. – jewelsea Oct 02 '13 at 15:51
  • You're right. My problem come from somewhere else. Eclipse can't resolve the following import "java.util.regex.Pattern;" I don't understand why ... I use the JDK8 http://imagesup.org/images11/1380788360-pattern.png – Lionel Père Oct 03 '13 at 08:19