Eclipse でjava8を勉強中です。
JavaFXWnd.javaをEclipse エディタで編集するとエラーだらけになります。
少しのエラーだと何とかなりそうですが、
ほぼすべての行でエラーになります。JavaFXWnd.javaのコードの下にエラーを張り付けています。
解決策、またはヒントを教えてください。お願いいたします。
//エラーの内容
Exception in Application start method
Exception in thread "main" 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 sun.launcher.LauncherHelper$FXHelper.main(LauncherHelper.java:767)
Caused by: java.lang.RuntimeException: Exception in Application start method
at com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:917)
at com.sun.javafx.application.LauncherImpl.lambda$launchApplication$154(LauncherImpl.java:182)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.Error: Unresolved compilation problems:
override を型に解決できません
アクセス制限: The type 'Stage' is not API (restriction on required library 'C:\pleiades\eclipse\jre\jre\lib\ext\jfxrt.jar')
アクセス制限: The method 'Stage.setTitle(String)' is not API (restriction on required library 'C:\pleiades\eclipse\jre\jre\lib\ext\jfxrt.jar')
アクセス制限: The method 'Window.setWidth(double)' is not API (restriction on required library 'C:\pleiades\eclipse\jre\jre\lib\ext\jfxrt.jar')
アクセス制限: The method 'Window.setHeight(double)' is not API (restriction on required library 'C:\pleiades\eclipse\jre\jre\lib\ext\jfxrt.jar')
アクセス制限: The type 'Label' is not API (restriction on required library 'C:\pleiades\eclipse\jre\jre\lib\ext\jfxrt.jar')
アクセス制限: The constructor 'Label(String)' is not API (restriction on required library 'C:\pleiades\eclipse\jre\jre\lib\ext\jfxrt.jar')
アクセス制限: The type 'Label' is not API (restriction on required library 'C:\pleiades\eclipse\jre\jre\lib\ext\jfxrt.jar')
アクセス制限: The method 'Labeled.setFont(Font)' is not API (restriction on required library 'C:\pleiades\eclipse\jre\jre\lib\ext\jfxrt.jar')
アクセス制限: The constructor 'Font(double)' is not API (restriction on required library 'C:\pleiades\eclipse\jre\jre\lib\ext\jfxrt.jar')
アクセス制限: The type 'Font' is not API (restriction on required library 'C:\pleiades\eclipse\jre\jre\lib\ext\jfxrt.jar')
アクセス制限: The method 'Stage.setScene(Scene)' is not API (restriction on required library 'C:\pleiades\eclipse\jre\jre\lib\ext\jfxrt.jar')
アクセス制限: The constructor 'Scene(Parent)' is not API (restriction on required library 'C:\pleiades\eclipse\jre\jre\lib\ext\jfxrt.jar')
アクセス制限: The type 'Scene' is not API (restriction on required library 'C:\pleiades\eclipse\jre\jre\lib\ext\jfxrt.jar')
アクセス制限: The method 'Stage.show()' is not API (restriction on required library 'C:\pleiades\eclipse\jre\jre\lib\ext\jfxrt.jar')
at sample_topic14.JavaFXWnd.start(JavaFXWnd.java:13) at com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$161(LauncherImpl.java:863) at com.sun.javafx.application.PlatformImpl.lambda$runAndWait$174(PlatformImpl.java:326) at com.sun.javafx.application.PlatformImpl.lambda$null$172(PlatformImpl.java:295) at java.security.AccessController.doPrivileged(Native Method) at com.sun.javafx.application.PlatformImpl.lambda$runLater$173(PlatformImpl.java:294) at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95) at com.sun.glass.ui.win.WinApplication._runLoop(Native Method) at com.sun.glass.ui.win.WinApplication.lambda$null$147(WinApplication.java:177) ... 1 more
// JavaFXWnd.java import javafx.application.Application; import javafx.scene.Scene; import javafx.scene.control.Label; import javafx.scene.text.Font; import javafx.stage.Stage; public class JavaFXWnd extends Application { public void start(Stage stage) throws Exception { stage.setTitle("Hello, JavaFX"); stage.setWidth(520); stage.setHeight(220); Label lblMsg = new Label("Hello, JavaFX"); lblMsg.setFont(new Font(80)); stage.setScene(new Scene(lblMsg)); stage.show(); } }
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
退会済みユーザー
2018/08/07 05:48
2018/08/07 06:03