Aloha Leute,
wie kriege ich die view vorgeschaltet ?
java.lang.NullPointerException
at de.dokumenten.controller.Main.neuesProfil(Main.java:68)
at de.dokumenten.controller.Main.start(Main.java:27)
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.gtk.GtkApplication._runLoop(Native Method)
at com.sun.glass.ui.gtk.GtkApplication.lambda$null$49(GtkApplication.java:139)
at java.lang.Thread.run(Thread.java:745)
wie kriege ich die view vorgeschaltet ?
Java:
public void neuesProfil() {
try {
// Load NeuesProfil overview.
FXMLLoader loader = new FXMLLoader();
loader.setLocation(Main.class.getResource("../view/NeuesProfil.fxml"));
AnchorPane neuesProfilOverview = (AnchorPane) loader.load();
// Set NeuesProfil overview into the center of root layout.
rootLayout.setCenter(neuesProfilOverview);
} catch (IOException e) {
e.printStackTrace();
}
}
java.lang.NullPointerException
at de.dokumenten.controller.Main.neuesProfil(Main.java:68)
at de.dokumenten.controller.Main.start(Main.java:27)
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.gtk.GtkApplication._runLoop(Native Method)
at com.sun.glass.ui.gtk.GtkApplication.lambda$null$49(GtkApplication.java:139)
at java.lang.Thread.run(Thread.java:745)
Code:
<?xml version="1.0" encoding="UTF-8"?>
<?import javafx.scene.control.Button?>
<?import javafx.scene.control.Label?>
<?import javafx.scene.control.TextField?>
<?import javafx.scene.layout.AnchorPane?>
<AnchorPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="400.0" prefWidth="600.0" xmlns="http://javafx.com/javafx/8.0.65" xmlns:fx="http://javafx.com/fxml/1">
<children>
<TextField accessibleHelp="ycyxcyxc" layoutX="29.0" layoutY="36.0" promptText="Datenbank Name" text="Datenbank Name" />
<TextField layoutX="29.0" layoutY="93.0" prefHeight="26.0" prefWidth="355.0" promptText="Der Pfad wo die Datenbank gespeichert verden soll" />
<Button layoutX="421.0" layoutY="93.0" mnemonicParsing="false" text="Durchsuchen" />
<Button layoutX="269.0" layoutY="360.0" mnemonicParsing="false" text="Profil Erstellen" />
<TextField layoutX="29.0" layoutY="154.0" promptText="Benutzer Name" />
<TextField layoutX="29.0" layoutY="207.0" prefHeight="26.0" prefWidth="446.0" promptText="Optional mehrere Mitbenutzer mit Kommer (,) trennen (Harry,Jan)" />
<Label layoutX="231.0" layoutY="14.0" text="Neues Profil Erstellen" />
</children>
</AnchorPane>