I am trying to implement a basic Javafx application, FXMLLoader.load can't seem to load in my Test.fxml file, which I made using Scene Builder 2.0
public class Main extends Application {
public void start(Stage primaryStage) {
try {
Parent root = FXMLLoader.load(getClass().getResource("Test.fxml"));
Scene scene = new Scene(root);
scene.getStylesheets().add(getClass().getResource("application.css").toExternalForm());
primaryStage.setTitle("FXML Welcome");
primaryStage.setScene(scene);
primaryStage.show();
} catch(Exception e) {
e.printStackTrace(System.out);
}
}
public static void main(String[] args) {
launch(args);
}
}
And it gives the following exception:
Java Model Exception: Java Model Status [Unknown javadoc format for FXML {key=Ljavafx/fxml/FXML;} [in FXML.class [in javafx.fxml [in C:\Program Files\Java\jre1.8.0_20\lib\ext\jfxrt.jar]]]] at org.eclipse.jdt.internal.core.JavadocContents.getTypeDoc(JavadocContents.java:81) at org.eclipse.jdt.internal.core.BinaryType.getAttachedJavadoc(BinaryType.java:999) at org.eclipse.jdt.internal.ui.text.javadoc.JavadocContentAccess2.getHTMLContent(JavadocContentAccess2.java:500) at org.eclipse.jdt.internal.ui.text.java.hover.JavadocHover.getHoverInfo(JavadocHover.java:689) at org.eclipse.jdt.internal.ui.text.java.hover.JavadocHover.internalGetHoverInfo(JavadocHover.java:607) at org.eclipse.jdt.internal.ui.text.java.hover.JavadocHover.getHoverInfo2(JavadocHover.java:599) at org.eclipse.jdt.internal.ui.text.java.hover.BestMatchHover.getHoverInfo2(BestMatchHover.java:163) at org.eclipse.jdt.internal.ui.text.java.hover.BestMatchHover.getHoverInfo2(BestMatchHover.java:129) at org.eclipse.jdt.internal.ui.text.java.hover.JavaEditorTextHoverProxy.getHoverInfo2(JavaEditorTextHoverProxy.java:85) at org.eclipse.jface.text.TextViewerHoverManager$4.run(TextViewerHoverManager.java:166)
My Test.fxml file is in the same directory as my Main.java.
Problem was pathing since creating a new project put my Main.java into an application package so it worked liek this :