Hallo Männers,
ich versuche mich grade in JavaFX und habe da ein kleines Problem, ich bekomme immer einen Fehler bei diesem Code.
Java-Version: JDK 8u45 64Bit
und der Fehler, den ich bekomme ist:
Ich habe aber keinen Ansatz um das Problem zu lösen.
Hilfe!!!
ich versuche mich grade in JavaFX und habe da ein kleines Problem, ich bekomme immer einen Fehler bei diesem Code.
Java-Version: JDK 8u45 64Bit
Java:
import javafx.scene.control.Alert;
import javafx.scene.control.Alert.AlertType;
public class Test {
public Test() {
// TODO Auto-generated constructor stub
}
public static void main(String[] args) {
Alert alert = new Alert(AlertType.INFORMATION);
alert.setTitle("Information Dialog");
alert.setHeaderText(null);
alert.setContentText("I must inform you that …");
alert.showAndWait();
}
}
und der Fehler, den ich bekomme ist:
Code:
Exception in thread "main" java.lang.ExceptionInInitializerError
at javafx.scene.control.DialogPane.createContentLabel(DialogPane.java:166)
at javafx.scene.control.DialogPane.<init>(DialogPane.java:217)
at javafx.scene.control.Dialog.<init>(Dialog.java:478)
at javafx.scene.control.Alert.<init>(Alert.java:245)
at javafx.scene.control.Alert.<init>(Alert.java:223)
at main.Test.main(Test.java:13)
Caused by: java.lang.IllegalStateException: Toolkit not initialized
at com.sun.javafx.application.PlatformImpl.runLater(PlatformImpl.java:273)
at com.sun.javafx.application.PlatformImpl.runLater(PlatformImpl.java:268)
at com.sun.javafx.application.PlatformImpl.setPlatformUserAgentStylesheet(PlatformImpl.java:550)
at com.sun.javafx.application.PlatformImpl.setDefaultPlatformUserAgentStylesheet(PlatformImpl.java:512)
at javafx.scene.control.Control.<clinit>(Control.java:87)
... 6 more
Ich habe aber keinen Ansatz um das Problem zu lösen.
Hilfe!!!