How to Install JavaFX + SceneBuilder with working FXML Loader WINDOWS (Eclipse 2021 newest version)

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello and welcome to a tutorial where i will show you how to install javafx on eclipse so first of all we have to have eclipse opened and go to help to eclipse marketplace and in find go and search javafx and then you have to install efx eclipse 3.7.0 depending on your machine this will take some time after you do that you have to restart eclipse okay the next part which is very important is to go to this website which is going to be in the description scroll down to windows to monocle sdk make sure it's the same version of windows that you have on your computer and go ahead and click on download i already have it downloaded but this is going to be the winrar which we'll see okay i have it downloaded on my desktop what you're going to have to do is export it and wear it somewhere and then put it in a place where you won't delete it so for example in my case i'm going to go ahead and put it in program files because i don't normally delete stuff from there after that we have to go back to eclipse go to window preferences and up here go ahead and search user we're going to be going to user libraries double click on it you will see these user libraries now you go ahead and click new write java fx or whatever you want click ok and then click on it click add external jars and then you will go ahead and search for the file that you placed in my case in program files in javafx sdk now from here you are going to select libraries and select all of the jars and hit open okay now you hit apply and close and now you can create a new click new other type javafx wait for it to load and go ahead and load a javafx project give it a name in this case test project for me click ahead go ahead and click finish and now you will see that we have some things but they don't work so you can see that we have problems here alright so in order to fix these problems we have to go ahead and click right click on our project go to build path configure build path and then here is the magic we have to move java fx sdk over to class path and then in module path add library user library and add the one which you added earlier which is javafx okay now if we go ahead and click play in the play and close we will see that our errors are going to be gone and we can run the project so if you hit run it works but now there is a catch let's say you have this type of code which is going to be in the description as well and you want to load an fxml loader now it sometimes doesn't work as you can see here if you you copied the code but if you remove this import save and then go ahead scroll down to this import fxn and hit on it you will see that the error is going to be gone okay now we want to run this program we don't have it so let's create it first right click new package resources and in resources we will add the example.fxml this example.fxml is yet again going to be in the description okay now if you try to run it you are going to see that it works all right now that we know that it works as you can see it works we have to avoid some possible errors so let's say that we wrote the code badly and for example our example is not in the path which we specified so if we run it now we are going to get a bunch of errors now there is something which you have to do in order to know at least what these errors are so if you do that and you get this type of error you go to fxml loader.java and hit on it and it will open something like this so eclipse doesn't know and doesn't have the documentation for fxml loader.java so we hit attach source go to external location external file and now go to wherever you placed that java folder go into it and select that is src.zip hit on open okay and now we have all of the code now of course we'll still get said error because we do not have that file but at least now we will have the documentation which tells us what to do at least so in order to fix that error i just go ahead and remove that resources and it will run yet again all right now if you want to modify an fxml file you can of course do it in code but who has time for that so in order to modify it you would normally go with right click and open scene builder now for me it will work and now it doesn't work if you will try and do that open it in builder you will also get this error so in order to fix that you have to start this installer which we will do right now all right that was fast now going back to eclipse we will try it again and it will still not work okay what we have to do is try and find scene builder right click on it open file location and then click on the path and copy it now we close it all right now go to window preferences and search for javafx now if you find javafx and click on it you will get to this screen which lets eclipse know where scene builder is now go ahead and click browse click here delete it paste the path which we saved hit enter click on scene builder and open hit apply apply and close and now if you right click on example.fxml and open with scene builder you will see that scene builder will open for us and we can modify the fxml file good luck
Info
Channel: Sergiu Darie
Views: 265
Rating: undefined out of 5
Keywords: java, javafx, fxml, javafx java eclipse, eclipse, eclipse javafx, javafx fix, javafx fxml, fxmlloader, how to, how to install, how to install javafx, how to install javafx eclipse, how to eclipse, how to eclipse javafx, how to eclipse javafx fxml, scenebuilder, scene builder javafx, scene builder javafx fxml
Id: UhVOv0Uh2J4
Channel Id: undefined
Length: 7min 0sec (420 seconds)
Published: Mon Nov 22 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.