0

so here it is.. i am new to javaFX and trying to run my first code so this is the error i get.. dont have any idea what is means!

Exception in Application constructor
java.lang.reflect.InvocationTargetException
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at com.sun.javafx.application.LauncherImpl.launchApplicationWithArgs(Unknown Source)
    at com.sun.javafx.application.LauncherImpl.launchApplication(Unknown Source)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at sun.launcher.LauncherHelper$FXHelper.main(Unknown Source)
Caused by: java.lang.RuntimeException: Unable to construct Application instance: class fx_example.example
    at com.sun.javafx.application.LauncherImpl.launchApplication1(Unknown Source)
    at com.sun.javafx.application.LauncherImpl.lambda$launchApplication$152(Unknown Source)
    at com.sun.javafx.application.LauncherImpl$$Lambda$50/1323468230.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.reflect.InvocationTargetException
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
    at java.lang.reflect.Constructor.newInstance(Unknown Source)
    at com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$158(Unknown Source)
    at com.sun.javafx.application.LauncherImpl$$Lambda$51/788672666.run(Unknown Source)
    at com.sun.javafx.application.PlatformImpl.lambda$runAndWait$172(Unknown Source)
    at com.sun.javafx.application.PlatformImpl$$Lambda$46/186276003.run(Unknown Source)
    at com.sun.javafx.application.PlatformImpl.lambda$null$170(Unknown Source)
    at com.sun.javafx.application.PlatformImpl$$Lambda$48/622793233.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at com.sun.javafx.application.PlatformImpl.lambda$runLater$171(Unknown Source)
    at com.sun.javafx.application.PlatformImpl$$Lambda$47/237061348.run(Unknown Source)
    at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(Unknown Source)
    at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
    at com.sun.glass.ui.win.WinApplication.lambda$null$145(Unknown Source)
    at com.sun.glass.ui.win.WinApplication$$Lambda$36/2117255219.run(Unknown Source)
    ... 1 more
Caused by: java.lang.NullPointerException: Root cannot be null
    at javafx.scene.Scene.<init>(Unknown Source)
    at javafx.scene.Scene.<init>(Unknown Source)
    at fx_example.example.<init>(example.java:12)
    ... 18 more
Exception running application fx_example.example
  1. i am new to all this and dont know wt it means... i really wanna know more about fx
Nelson John
  • 144
  • 2
  • 16
  • 1
    Okay, you posted the exception... but this is useless without program code. Please post the relevant code as well. – Turing85 Jul 12 '15 at 09:09
  • It means you have a [`NullPointerException`](http://stackoverflow.com/questions/218384/what-is-a-null-pointer-exception-and-how-do-i-fix-it) caused by passing a `null` value to the `Scene` constructor ("at `java.scene.Scene.`") which you call from line 12 of `example.java` ("at `fx_example.example.` (example.java:12)"). – James_D Jul 12 '15 at 13:10
  • thanx guys i found out i had problem in my code – Nelson John Jul 13 '15 at 15:33

0 Answers0