Check out example codes for "setting up javafx in eclipse". It will help you in understanding the concepts better.

Code Example 1

After creating a new Java Project:
Open the Java Build Path property (right click the Project, select Build Path > Configure Build Path...)
Open the Libraries tab, select the JRE System Library and "Remove" it. The system library may be named something like "JRE System Library[JavaSE-1.8]".
Click "Add Library...", in the next popup, select "Java System Library" (should be the first choice), and on the next screen "Workspace default JRE (jre[VERSION#])" (should be the last radio button), and "Finish".

Learn ReactJs, React Native from akashmittal.com