-2
我在NETBEANS 7.3.1上用JAVAFx創建一個圖形界面,我遇到了問題;該堆棧跟蹤javafx錯誤:未指定頁面語言
Executing com.javafx.main.Main from C:\Users\Guillaume\Documents\NetBeansProjects4\JavaFXApplication1\dist\run1976733325\JavaFXApplication1.jar using platform C:\Program Files\Java\jdk1.7.0_80/bin/java
Page language not specified.
file:/C:/Users/Guillaume/Documents/NetBeansProjects4/JavaFXApplication1/dist/run1976733325/JavaFXApplication1.jar!/javafxapplication1/Sample.fxml:30
at javafx.fxml.FXMLLoader$Element.processEventHandlerAttributes(FXMLLoader.java:510)
at javafx.fxml.FXMLLoader$ValueElement.processEndElement(FXMLLoader.java:594)
at javafx.fxml.FXMLLoader.processEndElement(FXMLLoader.java:2472)
at javafx.fxml.FXMLLoader.load(FXMLLoader.java:2177)
at javafx.fxml.FXMLLoader.load(FXMLLoader.java:2069)
at javafx.fxml.FXMLLoader.load(FXMLLoader.java:2830)
at javafx.fxml.FXMLLoader.load(FXMLLoader.java:2809)
at javafx.fxml.FXMLLoader.load(FXMLLoader.java:2795)
at javafx.fxml.FXMLLoader.load(FXMLLoader.java:2782)
at javafx.fxml.FXMLLoader.load(FXMLLoader.java:2771)
at javafxapplication1.JavaFXApplication1.start(JavaFXApplication1.java:21)
at com.sun.javafx.application.LauncherImpl$5.run(LauncherImpl.java:319)
at com.sun.javafx.application.PlatformImpl$5.run(PlatformImpl.java:219)
at com.sun.javafx.application.PlatformImpl$4$1.run(PlatformImpl.java:182)
at com.sun.javafx.application.PlatformImpl$4$1.run(PlatformImpl.java:179)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.javafx.application.PlatformImpl$4.run(PlatformImpl.java:179)
at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:76)
at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
at com.sun.glass.ui.win.WinApplication.access$100(WinApplication.java:17)
at com.sun.glass.ui.win.WinApplication$3$1.run(WinApplication.java:67)
at java.lang.Thread.run(Thread.java:745)
Exception in Application start method
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at com.javafx.main.Main.launchApp(Main.java:698)
at com.javafx.main.Main.main(Main.java:871)
Caused by: java.lang.RuntimeException: Exception in Application start method
at com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:403)
at com.sun.javafx.application.LauncherImpl.access$000(LauncherImpl.java:47)
at com.sun.javafx.application.LauncherImpl$1.run(LauncherImpl.java:115)
at java.lang.Thread.run(Thread.java:745)
Caused by: javafx.fxml.LoadException: Page language not specified.
at javafx.fxml.FXMLLoader$Element.processEventHandlerAttributes(FXMLLoader.java:510)
at javafx.fxml.FXMLLoader$ValueElement.processEndElement(FXMLLoader.java:594)
at javafx.fxml.FXMLLoader.processEndElement(FXMLLoader.java:2472)
at javafx.fxml.FXMLLoader.load(FXMLLoader.java:2177)
at javafx.fxml.FXMLLoader.load(FXMLLoader.java:2069)
at javafx.fxml.FXMLLoader.load(FXMLLoader.java:2830)
at javafx.fxml.FXMLLoader.load(FXMLLoader.java:2809)
at javafx.fxml.FXMLLoader.load(FXMLLoader.java:2795)
at javafx.fxml.FXMLLoader.load(FXMLLoader.java:2782)
at javafx.fxml.FXMLLoader.load(FXMLLoader.java:2771)
at javafxapplication1.JavaFXApplication1.start(JavaFXApplication1.java:21)
at com.sun.javafx.application.LauncherImpl$5.run(LauncherImpl.java:319)
at com.sun.javafx.application.PlatformImpl$5.run(PlatformImpl.java:219)
at com.sun.javafx.application.PlatformImpl$4$1.run(PlatformImpl.java:182)
at com.sun.javafx.application.PlatformImpl$4$1.run(PlatformImpl.java:179)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.javafx.application.PlatformImpl$4.run(PlatformImpl.java:179)
at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:76)
at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
at com.sun.glass.ui.win.WinApplication.access$100(WinApplication.java:17)
at com.sun.glass.ui.win.WinApplication$3$1.run(WinApplication.java:67)
... 1 more
Java Result: 1
的FXML文件是:
<?xml version="1.0" encoding="UTF-8"?>
<?import java.lang.*?>
<?import java.util.*?>
<?import javafx.collections.*?>
<?import javafx.scene.*?>
<?import javafx.scene.control.*?>
<?import javafx.scene.layout.*?>
<AnchorPane id="AnchorPane" prefHeight="307.0" prefWidth="503.0" xmlns:fx="http://javafx.com/fxml/1" xmlns="http://javafx.com/javafx/2.2">
<children>
<Label id="lb_config" layoutX="14.0" layoutY="4.0" prefHeight="37.0" prefWidth="252.0" text="Configuration de compteurs SDM120" />
<Label id="lb_select" layoutX="93.0" layoutY="70.0" text="Selection compteur adresse n°" />
<Label id="lb_config_act" layoutX="82.0" layoutY="126.0" text="Configuration actuelle :" />
<Label id="lb_vit" layoutX="93.0" layoutY="154.0" text="Vitesse de transmission" />
<Label id="lb_tps" layoutX="208.0" layoutY="203.0" text="Temps" />
<Label id="lb_imp" layoutX="134.0" layoutY="244.0" text="Sortie à impulsion" />
<Button fx:id="bt_modif" layoutX="364.0" layoutY="273.0" mnemonicParsing="false" text="Modifier" />
<TextField fx:id="tf_vit" layoutX="281.0" layoutY="154.0" prefWidth="200.0" />
<TextField fx:id="tf_tps" layoutX="281.0" layoutY="203.0" prefWidth="200.0" />
<TextField fx:id="tf_imp" layoutX="281.0" layoutY="241.0" prefWidth="200.0" />
<ComboBox fx:id="me_sel" layoutX="298.0" layoutY="67.0" prefWidth="183.0" promptText="Adresse du compteur">
<items>
<FXCollections fx:factory="observableArrayList">
<String fx:value="Item 1" />
<String fx:value="Item 2" />
</FXCollections>
</items>
</ComboBox>
<Button fx:id="bt_visualiser" layoutX="357.0" layoutY="105.0" mnemonicParsing="false" onAction="buttonAction" text="Visualiser" />
</children>
</AnchorPane>
請編輯您的問題以包含代碼,而不是粘貼鏈接。 –