當我跑我的應用程序,我是顯示錯誤的:
Caused by: java.lang.NullPointerException
at exmp.ui.UI.nodeEkle(UI.java:48)
at exmp.ui.Basic.<init>(Basic.java:47)
at exmp.MainWin.hazirla(MainWin.java:15)
at exmp.MainWin.<init>(MainWin.java:26)
at exmp.Start.start(Start.java:13)
at com.sun.javafx.application.LauncherImpl$5.run(LauncherImpl.java:319)
at com.sun.javafx.application.PlatformImpl$5.run(PlatformImpl.java:215)
at com.sun.javafx.application.PlatformImpl$4$1.run(PlatformImpl.java:179)
at com.sun.javafx.application.PlatformImpl$4$1.run(PlatformImpl.java:176)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.javafx.application.PlatformImpl$4.run(PlatformImpl.java:176)
at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
at com.sun.glass.ui.win.WinApplication.access$100(WinApplication.java:29)
at com.sun.glass.ui.win.WinApplication$3$1.run(WinApplication.java:73)
... 1 more
所有工作正常,但唯一的問題nodeEkle方法,當我調試我的應用程序我顯示場景爲空,但如何?我在方法中創造場景;
public void gerekliUIVerileriniOlustur(){
group = new Group();
scene = SceneBuilder.create()
.root(group)
.fill(Color.BLANCHEDALMOND)
.build();
所以我嘗試場景靜態>公共靜態場景場景;但不工作我得到了另一個錯誤。所以我怎麼能解決這個問題。
以文本而非屏幕截圖的形式發佈代碼是首選。 – jewelsea