Estou tentendo abrir um FXML mas esta voltando esse erro:
Codigo:
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package arctech_datacontroller;
import javafx.application.Application;
import static javafx.application.Application.launch;
import javafx.fxml.FXMLLoader;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.scene.layout.AnchorPane;
import javafx.stage.Stage;
/**
*
* @author Matheus Markies
*/
public class ArcTech_DataController extends Application{
@Override
public void start(Stage stage) throws Exception {
FXMLLoader loader = new FXMLLoader(this.getClass().getResource("MainFrame/MainFrameADM_FXML.fxml"));
Parent root = loader.load();
stage.setScene(new Scene(root));
stage.show();
}
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
launch(args);
}
}
FXML:
<?xml version="1.0" encoding="UTF-8"?>
<?import com.gluonhq.charm.glisten.control.Avatar?>
<?import java.net.URL?>
<?import javafx.scene.chart.BarChart?>
<?import javafx.scene.chart.CategoryAxis?>
<?import javafx.scene.chart.NumberAxis?>
<?import javafx.scene.chart.PieChart?>
<?import javafx.scene.control.Label?>
<?import javafx.scene.effect.DropShadow?>
<?import javafx.scene.image.Image?>
<?import javafx.scene.image.ImageView?>
<?import javafx.scene.layout.AnchorPane?>
<?import javafx.scene.layout.Pane?>
<?import javafx.scene.text.Font?>
<AnchorPane id="AnchorPane" prefHeight="720.0" prefWidth="1080.0" styleClass="mainFxmlClass" xmlns="http://javafx.com/javafx/8.0.171" xmlns:fx="http://javafx.com/fxml/1" fx:controller="arctech_datacontroller.MainFrame.MainFrameADM_FXMLController">
<stylesheets>
<URL value="@mainframeadm_fxml.css" />
</stylesheets>
<children>
<Pane prefHeight="137.0" prefWidth="1081.0" style="-fx-background-color: #1B8DFF;">
<children>
<Avatar layoutX="938.0" layoutY="49.0" radius="20.0">
<image>
<Image url="@../../../../../../Downloads/304914003411425.jpg" />
</image>
</Avatar>
<Label layoutX="985.0" layoutY="59.0" text="Arc Tech">
<font>
<Font name="Nirmala UI" size="15.0" />
</font>
</Label>
<Label layoutX="985.0" layoutY="74.0" text="Admin">
<font>
<Font name="Nirmala UI" size="9.0" />
</font>
</Label>
</children></Pane>
<Pane layoutY="137.0" prefHeight="583.0" prefWidth="1081.0" style="-fx-background-color: #E3E3E3;" styleClass="mainFxmlClass" stylesheets="@mainframeadm_fxml.css">
<children>
<Pane layoutX="25.0" layoutY="17.0" prefHeight="203.0" prefWidth="279.0" style="-fx-background-color: #ffffff;">
<children>
<Avatar layoutX="14.0" layoutY="33.0" radius="30.0">
<image>
<Image url="@../../../../../../Downloads/304914003411425.jpg" />
</image>
</Avatar>
<Label layoutX="81.0" layoutY="50.0" text="User">
<font>
<Font name="Nirmala UI" size="18.0" />
</font>
</Label>
</children>
<effect>
<DropShadow color="#00000040" height="26.93" offsetX="1.0" offsetY="2.0" radius="11.4825" />
</effect></Pane>
<Pane layoutX="14.0" layoutY="254.0" prefHeight="255.0" prefWidth="296.0" style="-fx-background-color: #ffffff;">
<effect>
<DropShadow blurType="GAUSSIAN" color="#00000040" height="26.93" offsetX="1.0" offsetY="2.0" radius="11.4825" />
</effect>
<children>
<PieChart layoutX="48.0" layoutY="14.0" prefHeight="128.0" prefWidth="158.0" title="Storage" />
<ImageView fitHeight="13.0" fitWidth="19.0" layoutX="48.0" layoutY="228.0" pickOnBounds="true" preserveRatio="true">
<image>
<Image url="@../../../../../../Downloads/Orage.png" />
</image>
</ImageView>
<ImageView fitHeight="13.0" fitWidth="19.0" layoutX="48.0" layoutY="206.0" pickOnBounds="true" preserveRatio="true">
<image>
<Image url="@../../../../../../Downloads/Green.png" />
</image>
</ImageView>
<ImageView fitHeight="13.0" fitWidth="19.0" layoutX="209.0" layoutY="206.0" pickOnBounds="true" preserveRatio="true">
<image>
<Image url="@../../../../../../Downloads/Pink.png" />
</image>
</ImageView>
<ImageView fitHeight="13.0" fitWidth="19.0" layoutX="209.0" layoutY="228.0" pickOnBounds="true" preserveRatio="true">
<image>
<Image url="@../../../../../../Downloads/Red.png" />
</image>
</ImageView>
<Label layoutX="61.0" layoutY="206.0" text="Iten A">
<font>
<Font name="Nirmala UI" size="9.0" />
</font>
</Label>
<Label layoutX="61.0" layoutY="228.0" text="Iten B">
<font>
<Font name="Nirmala UI" size="9.0" />
</font>
</Label>
<Label layoutX="222.0" layoutY="206.0" text="Iten C">
<font>
<Font name="Nirmala UI" size="9.0" />
</font>
</Label>
<Label layoutX="222.0" layoutY="228.0" text="Others">
<font>
<Font name="Nirmala UI" size="9.0" />
</font>
</Label>
</children></Pane>
<Pane layoutX="383.0" layoutY="17.0" prefHeight="203.0" prefWidth="315.0" style="-fx-background-color: #ffffff;">
<effect>
<DropShadow color="#00000040" height="26.93" offsetX="1.0" offsetY="2.0" radius="11.4825" />
</effect></Pane>
<Pane layoutX="359.0" layoutY="252.0" prefHeight="259.0" prefWidth="363.0" style="-fx-background-color: #ffffff;">
<effect>
<DropShadow color="#00000040" height="26.93" offsetX="1.0" offsetY="2.0" radius="11.4825" />
</effect>
<children>
<BarChart layoutY="65.0" prefHeight="180.0" prefWidth="353.0">
<xAxis>
<CategoryAxis side="BOTTOM" />
</xAxis>
<yAxis>
<NumberAxis side="LEFT" />
</yAxis>
</BarChart>
<Label layoutX="14.0" layoutY="15.0" text="Company + ID">
<font>
<Font name="Nirmala UI" size="18.0" />
</font>
</Label>
<Label layoutX="14.0" layoutY="42.0" text="Expenses">
<font>
<Font name="Nirmala UI" size="12.0" />
</font>
</Label>
</children></Pane>
<Pane layoutX="759.0" layoutY="15.0" prefHeight="498.0" prefWidth="308.0" style="-fx-background-color: #ffffff;">
<children>
<Label layoutX="14.0" layoutY="6.0" text="Messages:">
<font>
<Font name="Nirmala UI" size="21.0" />
</font>
</Label>
<Label layoutX="126.0" layoutY="229.0" text="No posts">
<font>
<Font name="Nirmala UI" size="14.0" />
</font>
</Label>
</children>
<effect>
<DropShadow color="#00000040" height="26.93" offsetX="1.0" offsetY="2.0" radius="11.4825" />
</effect>
</Pane>
</children>
</Pane>
</children>
</AnchorPane>
Erro:
run:
Exception in Application start method
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 com.sun.javafx.application.LauncherImpl.launchApplicationWithArgs(LauncherImpl.java:389)
at com.sun.javafx.application.LauncherImpl.launchApplication(LauncherImpl.java:328)
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$155(LauncherImpl.java:182)
at java.lang.Thread.run(Thread.java:745)
Caused by: javafx.fxml.LoadException:
/C:/Users/Matheus%20Markies/Documents/NetBeansProjects/ArcTech_DataController/build/classes/arctech_datacontroller/MainFrame/MainFrameADM_FXML.fxml
at javafx.fxml.FXMLLoader.constructLoadException(FXMLLoader.java:2601)
at javafx.fxml.FXMLLoader.importClass(FXMLLoader.java:2848)
at javafx.fxml.FXMLLoader.processImport(FXMLLoader.java:2692)
at javafx.fxml.FXMLLoader.processProcessingInstruction(FXMLLoader.java:2661)
at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:2517)
at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:2441)
at javafx.fxml.FXMLLoader.load(FXMLLoader.java:2409)
at arctech_datacontroller.ArcTech_DataController.start(ArcTech_DataController.java:26)
at com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$162(LauncherImpl.java:863)
at com.sun.javafx.application.PlatformImpl.lambda$runAndWait$175(PlatformImpl.java:326)
at com.sun.javafx.application.PlatformImpl.lambda$null$173(PlatformImpl.java:295)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.javafx.application.PlatformImpl.lambda$runLater$174(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$148(WinApplication.java:191)
... 1 more
Caused by: java.lang.ClassNotFoundException: com.gluonhq.charm.glisten.control.Avatar
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at javafx.fxml.FXMLLoader.loadTypeForPackage(FXMLLoader.java:2916)
at javafx.fxml.FXMLLoader.loadType(FXMLLoader.java:2905)
at javafx.fxml.FXMLLoader.importClass(FXMLLoader.java:2846)
... 15 more
Exception running application arctech_datacontroller.ArcTech_DataController
C:\Users\Matheus Markies\AppData\Local\NetBeans\Cache\8.2\executor-snippets\run.xml:53: Java returned: 1
FALHA NA CONSTRUÇÃO (tempo total: 1 segundo)