Scene builder開辟報錯:java.lang.reflect.InvocationTargetException解決方案。簡單幾步,讓你輕松解決。
1. 利用Scene builder開辟的時辰,呈現報錯如下,
Exception in Application start method
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.sun.javafx.application.LauncherImpl.launchApplicationWithArgs(LauncherImpl.java:389)
at com.sun.javafx.application.LauncherImpl.launchApplication(LauncherImpl.java:328)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at sun.launcher.LauncherHelper$FXHelper.main(LauncherHelper.java:767)
Caused by: java.lang.RuntimeException: Exception in Application start method
2. 找到建立好的.fxml文件,鼠標右鍵選擇【Open in Scen Builder】
3. 打開Scene builder后,點擊菜單欄View,彈出的菜單中選擇【Show Sample Controller Skeleton】
4. 步調3后,在彈出的窗口中,復制代碼
5. 找到Controller.java文件,進行粘貼代碼(注重類名)
6. 點擊IDE的運行按鈕,彈出結果如圖所示
若是您感覺有效,記得鄙人方點擊投票、點贊、存眷、留言,小編會按期送上更多的驚喜哦,您的撐持才是小編繼續盡力的動力,么么噠。
0 篇文章
如果覺得我的文章對您有用,請隨意打賞。你的支持將鼓勵我繼續創作!