Embark on a journey of knowledge! Take the quiz and earn valuable credits.
Take A QuizChallenge yourself and boost your learning! Start the quiz now to earn credits.
Take A QuizUnlock your potential! Begin the quiz, answer questions, and accumulate credits along the way.
Take A QuizGeneral Tech Bugs & Fixes 3 years ago
User submissions are the sole responsibility of contributors, with TuteeHUB disclaiming liability for accuracy, copyrights, or consequences of use; content is for informational purposes only and not professional advice.
This may not be what your looking for, but you could always use a FXML to java converter to create an abstract class.
Then you have the controller for the xml file extend the abstract class, you'll have to remove the initialize method (it's no longer necessary) and change the @FXML annotation for any methods that handle events to @Overrides.
Also you'll no longer need any of the fields with an @FXML annotation as all controls will be accessible through the abstract base class. If you use Netbeans there is a plugin to do this available through the plugin portal, or a stand alone jar file can be found here:https://www.tutorialon.com/p/fxmltojavaconverter.html
Then instead of loading fxml you just use the class constructor. For example if the root element in your FXML is a BorderPane, then you would use something like
BorderPane borderPane = new MyClass();
No matter what stage you're at in your education or career, TuteeHUB will help you reach the next level that you're aiming for. Simply,Choose a subject/topic and get started in self-paced practice sessions to improve your knowledge and scores.
Ready to take your education and career to the next level? Register today and join our growing community of learners and professionals.
Your experience on this site will be improved by allowing cookies. Read Cookie Policy
Your experience on this site will be improved by allowing cookies. Read Cookie Policy
manpreet
Best Answer
3 years ago
I obfuscated my javafx code that contains .fxml files for view. After successful obfuscation when i run the jar file using command line, it shows the error in main method that the code is unable to load .fxml file.
Please help