Exception in Application start method
java.lang.reflect.InvocationTargetException
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:564)
at javafx.graphics/com.sun.javafx.application.LauncherImpl.launchApplicationWithArgs(LauncherImpl.java:473)
at javafx.graphics/com.sun.javafx.application.LauncherImpl.launchApplication(LauncherImpl.java:372)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:564)
at java.base/sun.launcher.LauncherHelper$FXHelper.main(LauncherHelper.java:941)
Caused by: java.lang.RuntimeException: Exception in Application start method
at javafx.graphics/com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:973)
at javafx.graphics/com.sun.javafx.application.LauncherImpl.lambda$launchApplication$2(LauncherImpl.java:198)
at java.base/java.lang.Thread.run(Thread.java:844)
Caused by: javafx.fxml.LoadException:
/E:/programovanie/netgame/out/production/netgame/sample/sample.fxml:26
at javafx.fxml/javafx.fxml.FXMLLoader.constructLoadException(FXMLLoader.java:2625)
at javafx.fxml/javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:2603)
at javafx.fxml/javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:2466)
at javafx.fxml/javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:3253)
at javafx.fxml/javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:3210)
at javafx.fxml/javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:3179)
at javafx.fxml/javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:3152)
at javafx.fxml/javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:3129)
at javafx.fxml/javafx.fxml.FXMLLoader.load(FXMLLoader.java:3122)
at sample.Main.start(Main.java:13)
at javafx.graphics/com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$9(LauncherImpl.java:919)
at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runAndWait$11(PlatformImpl.java:449)
at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$9(PlatformImpl.java:418)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$10(PlatformImpl.java:417)
at javafx.graphics/com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:96)
at javafx.graphics/com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
at javafx.graphics/com.sun.glass.ui.win.WinApplication.lambda$runLoop$3(WinApplication.java:175)
... 1 more
Caused by: java.lang.IllegalArgumentException: Can not set org.w3c.dom.Text field sample.Controller.minuty to javafx.scene.text.Text
at java.base/jdk.internal.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(UnsafeFieldAccessorImpl.java:167)
at java.base/jdk.internal.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(UnsafeFieldAccessorImpl.java:171)
at java.base/jdk.internal.reflect.UnsafeObjectFieldAccessorImpl.set(UnsafeObjectFieldAccessorImpl.java:81)
at java.base/java.lang.reflect.Field.set(Field.java:780)
at javafx.fxml/javafx.fxml.FXMLLoader.injectFields(FXMLLoader.java:1174)
at javafx.fxml/javafx.fxml.FXMLLoader.access$1600(FXMLLoader.java:105)
at javafx.fxml/javafx.fxml.FXMLLoader$ValueElement.processValue(FXMLLoader.java:865)
at javafx.fxml/javafx.fxml.FXMLLoader$ValueElement.processStartElement(FXMLLoader.java:759)
at javafx.fxml/javafx.fxml.FXMLLoader.processStartElement(FXMLLoader.java:2722)
at javafx.fxml/javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:2552)
... 17 more
Exception running application sample.Main
<?xml version="1.0" encoding="UTF-8"?>
<?import javafx.geometry.Insets?>
<?import javafx.scene.control.Button?>
<?import javafx.scene.control.Slider?>
<?import javafx.scene.layout.AnchorPane?>
<?import javafx.scene.layout.ColumnConstraints?>
<?import javafx.scene.layout.GridPane?>
<?import javafx.scene.layout.RowConstraints?>
<?import javafx.scene.text.Font?>
<?import javafx.scene.text.Text?>
<AnchorPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="600.0" prefWidth="900.0" xmlns="http://javafx.com/javafx/8.0.172-ea" xmlns:fx="http://javafx.com/fxml/1" fx:controller="sample.Controller">
<children>
<GridPane minHeight="100.0" minWidth="900.0" style="-fx-background-color: #CDE8C8; -fx-border-color: black;">
<columnConstraints>
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
</columnConstraints>
<rowConstraints>
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
</rowConstraints>
<children>
<Text fx:id="minuty" strokeType="OUTSIDE" strokeWidth="0.0" text="00" wrappingWidth="225.125">
<font>
<Font size="40.0" />
</font>
<GridPane.margin>
<Insets left="50.0" />
</GridPane.margin>
</Text>
<Text strokeType="OUTSIDE" strokeWidth="0.0" text=":" textAlignment="CENTER" wrappingWidth="224.671875">
<font>
<Font size="40.0" />
</font>
</Text>
<Text fx:id="sekundy" strokeType="OUTSIDE" strokeWidth="0.0" text="00" textAlignment="RIGHT" wrappingWidth="176.9375">
<font>
<Font size="40.0" />
</font>
<GridPane.margin>
<Insets />
</GridPane.margin>
</Text>
<Text fx:id="stavcerveny" fill="RED" strokeType="OUTSIDE" strokeWidth="0.0" text="0" wrappingWidth="225.5625" GridPane.columnIndex="1">
<font>
<Font size="40.0" />
</font>
<GridPane.margin>
<Insets left="50.0" />
</GridPane.margin>
</Text>
<Text strokeType="OUTSIDE" strokeWidth="0.0" text=":" textAlignment="CENTER" wrappingWidth="225.671875" GridPane.columnIndex="1">
<font>
<Font size="40.0" />
</font>
</Text>
<Text fx:id="stavmodry" fill="#0073ff" strokeType="OUTSIDE" strokeWidth="0.0" text="0" textAlignment="RIGHT" wrappingWidth="157.5625" GridPane.columnIndex="1">
<font>
<Font size="40.0" />
</font>
</Text>
<Button alignment="CENTER" mnemonicParsing="false" onMouseClicked="#zapnutie" prefHeight="25.0" prefWidth="226.0" text="PLAY" GridPane.columnIndex="2">
<GridPane.margin>
<Insets bottom="40.0" left="40.0" right="40.0" />
</GridPane.margin>
</Button>
<Button mnemonicParsing="false" onMouseClicked="#restart" prefHeight="25.0" prefWidth="227.0" text="RESTART" textAlignment="CENTER" GridPane.columnIndex="2">
<opaqueInsets>
<Insets />
</opaqueInsets>
<GridPane.margin>
<Insets left="40.0" right="40.0" top="50.0" />
</GridPane.margin>
</Button>
<Slider fx:id="obtiazne" prefHeight="14.0" prefWidth="126.0" GridPane.columnIndex="3">
<GridPane.margin>
<Insets left="20.0" right="20.0" />
</GridPane.margin>
</Slider>
</children>
</GridPane>
<AnchorPane fx:id="hra" layoutY="100.0" prefHeight="500.0" prefWidth="900.0" />
</children>
</AnchorPane>
package sample;
import javafx.fxml.FXML;
import javafx.scene.control.Slider;
import javafx.scene.input.MouseEvent;
import javafx.scene.layout.AnchorPane;
import org.w3c.dom.Text;
public class Controller {
@FXML
Slider obtiazne;
@FXML
Text minuty;
@FXML
Text sekundy;
@FXML
Text stavcerveny;
@FXML
Text stavmodry;
@FXML
AnchorPane hra;
public void zapnutie(MouseEvent mouseEvent) {
System.out.println(obtiazne.getValue());
}
public void restart(MouseEvent mouseEvent) {
}
}
package sample;
import javafx.application.Application;
import javafx.fxml.FXMLLoader;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.stage.Stage;
public class Main extends Application {
@Override
public void start(Stage primaryStage) throws Exception{
Parent root = FXMLLoader.load(getClass().getResource("sample.fxml"));
primaryStage.setTitle("Hello World");
primaryStage.setScene(new Scene(root));
primaryStage.show();
}
public static void main(String[] args) {
launch(args);
}
}
这是:“Parent root=fxmlloader.load(getClass().getResource(”sample.fxml“));”
我不明白剩下的部分,所以我希望你能轻松地解决这个问题:)
堆栈跟踪的相关部分是
无法将org.w3c.dom.text字段sample.controller.minuty设置为javafx.scene.text.text
这意味着您在controller类中的导入是错误的
我是react native的新手,我正在尝试使用android Studio开始我的第一个项目。我遵循react native的“设置开发环境”中的说明,最终使用 然后我在android studio中打开了我的项目来启动AVD,但是gradle抛出了以下错误 错误:评估脚本时出现问题。 无法运行程序“node”(在目录“/home/deadshot/documents/playground/a
我有一个主活动MainActivity,它是我的android应用程序的入口点。它通过发射器正确发射。然而,当我尝试执行startActivity时,我看到活动试图启动的一些调试,一些代码正确启动,但MainActivity从未启动。 我认为这可能与意图有关: 对吗? 从内部活动来看,我有 我甚至看到 10-11 22:23:46.026:INFO/ActivityManager(472):从pi
问题内容: 如果html文件是本地文件(在我的C驱动器上),则可以使用,但是如果html文件在服务器上并且图像文件是本地文件,则无法使用。这是为什么? 任何可能的解决方法? 问题答案: 如果客户端可以请求本地文件系统文件,然后使用JavaScript找出其中的内容,则将是一个安全漏洞。 解决此问题的唯一方法是在浏览器中构建扩展。Firefox扩展和IE扩展可以访问本地资源。Chrome的限制更为严
我从JavaFXml开始,但我在编译程序方面遇到了问题。编译器显示了我的问题,我没有任何想法来解决这个问题。 我的Mine类: 我的控制器类: 我的sample.fxml文件 当我编译这个时,compiller会显示一个错误: 我试着解决它,就像在这一页上: https://github.com/openjfx/javafx-maven-plugin https://openjfx.io/open
我洛基,在“开始”之后,我遵循https://getbootstrap.com/docs/4.3/layout/overview/的指示(我猜在那个例子中缺少了一些东西) 我说: 链接到头标签中的css文件 但是它不起作用,类“hid-ph-flex”总是在“代码”显示中:无“代码”,火狐调试器警告说:“未知规则或错误读取规则在“包括” 我想我忘了一份文件,有什么帮助吗???
我有一个简单的JavaFX网络浏览器,它是一个模块。模块的目录结构是: 以下是模块信息的代码.java 以下是WebBrowser.java的代码: 我用javac编译我的模块化应用程序: 我可以用java启动我的应用程序,它运行良好: 当我试图使用jlink组装我的模块(webBrowser)和JavaFX模块时,问题就出现了: 运行链接的应用程序(如上)时,我得到以下RuntimeExcept