Hallo zusammen,
habe ein kleines Problem beim nach dem Update auf Java 8.
einer der Formulare in der Applikation bringt beim Versuch es zu öffnen folgende Fehlermeldung:
javafx.fxml.LoadException: Root hasn't been set.
Use method setRoot() before load.
Mein fxml Datei sieht folgendermaßen aus:
<?xml version="1.0" encoding="UTF-8"?>
<?import java.lang.*?>
<?import javafx.geometry.*?>
<?import javafx.scene.control.*?>
<?import javafx.scene.effect.*?>
<?import javafx.scene.layout.*?>
<?import javafx.scene.text.*?>
<?scenebuilder-preview-i18n-resource ../../../resources/Resources.properties?>
<fx:root id="AnchorPane" fx:id="countryAnchor" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="185.0" prefWidth="983.0" type="javafx.scene.layout.AnchorPane" xmlns:fx="http://javafx.com/fxml/1" xmlns="http://javafx.com/javafx/8" fx:controller="pl.s3.pathfinder.ui.common.address.AddressController">
<children>
<Label layoutX="10.0" layoutY="1.0" text="%address" textFill="#606060" textOverrun="CLIP">
<effect>
<ColorAdjust />
</effect>
<font>
<Font size="15.0" />
</font>
</Label>
<GridPane layoutY="31.0" prefHeight="84.0" prefWidth="963.0" AnchorPane.leftAnchor="10.0" AnchorPane.rightAnchor="10.0">
<children>
<Label text="%country" GridPane.columnIndex="0" GridPane.rowIndex="0">
<labelFor>
<AnchorPane id="countryPane" fx:id="countryAnchor" focusTraversable="true" prefHeight="19.0" prefWidth="140.0" GridPane.columnIndex="1" GridPane.rowIndex="0">
<rotationAxis>
<Point3D />
</rotationAxis>
</AnchorPane>
</labelFor>
</Label>
<fx:reference source="countryAnchor" />
<Label text="%zipCode" GridPane.columnIndex="2" GridPane.rowIndex="0">
<labelFor>
<AnchorPane fx:id="zipCodeAnchorPane" prefHeight="19.0" prefWidth="98.0" GridPane.columnIndex="3" GridPane.rowIndex="0">
<children>
<TextField fx:id="zipCodeTextField" layoutX="0.0" layoutY="0.0" onInputMethodTextChanged="#onZipCodeChanged" prefWidth="144.0" />
</children>
</AnchorPane>
</labelFor>
</Label>
<fx:reference source="zipCodeAnchorPane" />
<Label text="%city" GridPane.columnIndex="5" GridPane.rowIndex="0">
<labelFor>
<TextField id="city" fx:id="cityTextField" onInputMethodTextChanged="#onCityChanged" prefHeight="22.0" prefWidth="187.0" GridPane.columnIndex="6" GridPane.rowIndex="0" />
</labelFor>
</Label>
<fx:reference source="cityTextField" />
<Label text="%street" GridPane.columnIndex="0" GridPane.rowIndex="1">
<labelFor>
<AnchorPane fx:id="streetAnchorPane" prefHeight="19.0" prefWidth="140.0" GridPane.columnIndex="1" GridPane.rowIndex="1">
<children>
<TextField fx:id="streetTextField" layoutY="5.0" onInputMethodTextChanged="#onStreetChanged" prefWidth="200.0" />
</children>
</AnchorPane>
</labelFor>
</Label>
<fx:reference source="streetAnchorPane" />
<Label text="%number" GridPane.columnIndex="2" GridPane.rowIndex="1">
<labelFor>
<TextField id="number" fx:id="numberTextField" maxWidth="1.7976931348623157E308" minWidth="-Infinity" prefHeight="22.0" prefWidth="98.0" GridPane.columnIndex="3" GridPane.rowIndex="1" />
</labelFor>
</Label>
<fx:reference source="numberTextField" />
<Label text="%state" GridPane.columnIndex="5" GridPane.rowIndex="1">
<labelFor>
<TextField id="state" fx:id="stateTextField" prefHeight="22.0" prefWidth="187.0" GridPane.columnIndex="6" GridPane.rowIndex="1" />
</labelFor>
</Label>
<fx:reference source="stateTextField" />
<Label text="%extraInformation" GridPane.columnIndex="2" GridPane.rowIndex="2">
<labelFor>
<TextField fx:id="extraInformation" minWidth="-Infinity" prefHeight="22.0" prefWidth="427.0" GridPane.columnIndex="3" GridPane.rowIndex="2" />
</labelFor>
</Label>
<Label text="%mailboxNumber" GridPane.columnIndex="0" GridPane.rowIndex="2">
<labelFor>
<AnchorPane fx:id="mailboxNumberAnchorPane" prefHeight="19.0" prefWidth="140.0" GridPane.columnIndex="1" GridPane.rowIndex="2">
<children>
<TextField fx:id="mailBoxNumberTextField" layoutX="0.0" layoutY="6.0" prefWidth="200.0" />
</children>
</AnchorPane>
</labelFor>
</Label>
<fx:reference source="extraInformation" />
<fx:reference source="mailboxNumberAnchorPane" />
</children>
<columnConstraints>
<ColumnConstraints hgrow="SOMETIMES" maxWidth="172.0" minWidth="10.0" prefWidth="172.0" />
<ColumnConstraints hgrow="SOMETIMES" maxWidth="245.0" minWidth="10.0" prefWidth="221.0" />
<ColumnConstraints hgrow="SOMETIMES" maxWidth="196.0" minWidth="10.0" prefWidth="143.0" />
<ColumnConstraints hgrow="SOMETIMES" maxWidth="287.0" minWidth="10.0" prefWidth="144.0" />
<ColumnConstraints hgrow="SOMETIMES" maxWidth="56.0" minWidth="24.0" prefWidth="30.0" />
<ColumnConstraints hgrow="SOMETIMES" maxWidth="211.0" minWidth="10.0" prefWidth="44.0" />
<ColumnConstraints hgrow="SOMETIMES" maxWidth="291.0" minWidth="10.0" prefWidth="209.0" />
</columnConstraints>
<rowConstraints>
<RowConstraints maxHeight="30.0" minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
<RowConstraints maxHeight="30.0" minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
<RowConstraints maxHeight="30.0" minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
</rowConstraints>
</GridPane>
<GridPane fx:id="extraAnchorPane" layoutY="115.0" prefHeight="70.0" prefWidth="963.0" AnchorPane.leftAnchor="10.0" AnchorPane.rightAnchor="10.0">
<children>
<Label text="%by" GridPane.columnIndex="0" GridPane.rowIndex="0" />
<Label text="%actual" GridPane.columnIndex="0" GridPane.rowIndex="1" />
<CheckBox fx:id="stayByCheckBox" alignment="TOP_LEFT" contentDisplay="RIGHT" mnemonicParsing="false" selected="false" GridPane.columnIndex="1" GridPane.rowIndex="0" />
<CheckBox fx:id="actualCheckBox" alignment="TOP_LEFT" contentDisplay="RIGHT" mnemonicParsing="false" selected="true" GridPane.columnIndex="1" GridPane.rowIndex="1" />
<Label fx:id="recipientLabel" text="%recipient" visible="false" GridPane.columnIndex="2" GridPane.rowIndex="0" />
<TextField id="recipient" fx:id="recipientTextField" maxWidth="-Infinity" minWidth="-Infinity" prefWidth="140.0" visible="false" GridPane.columnIndex="3" GridPane.rowIndex="0" />
</children>
<columnConstraints>
<ColumnConstraints hgrow="SOMETIMES" maxWidth="184.0" minWidth="10.0" prefWidth="173.0" />
<ColumnConstraints hgrow="SOMETIMES" maxWidth="316.0" minWidth="10.0" prefWidth="220.0" />
<ColumnConstraints hgrow="SOMETIMES" maxWidth="529.0" minWidth="10.0" prefWidth="144.0" />
<ColumnConstraints hgrow="SOMETIMES" maxWidth="692.0" minWidth="10.0" prefWidth="426.0" />
<ColumnConstraints hgrow="SOMETIMES" maxWidth="486.0" minWidth="0.0" prefWidth="0.0" />
</columnConstraints>
<rowConstraints>
<RowConstraints maxHeight="30.0" minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
<RowConstraints maxHeight="30.0" minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
</rowConstraints>
</GridPane>
</children>
</fx:root>
Danke für eure Unterstützung
habe ein kleines Problem beim nach dem Update auf Java 8.
einer der Formulare in der Applikation bringt beim Versuch es zu öffnen folgende Fehlermeldung:
javafx.fxml.LoadException: Root hasn't been set.
Use method setRoot() before load.
Mein fxml Datei sieht folgendermaßen aus:
<?xml version="1.0" encoding="UTF-8"?>
<?import java.lang.*?>
<?import javafx.geometry.*?>
<?import javafx.scene.control.*?>
<?import javafx.scene.effect.*?>
<?import javafx.scene.layout.*?>
<?import javafx.scene.text.*?>
<?scenebuilder-preview-i18n-resource ../../../resources/Resources.properties?>
<fx:root id="AnchorPane" fx:id="countryAnchor" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="185.0" prefWidth="983.0" type="javafx.scene.layout.AnchorPane" xmlns:fx="http://javafx.com/fxml/1" xmlns="http://javafx.com/javafx/8" fx:controller="pl.s3.pathfinder.ui.common.address.AddressController">
<children>
<Label layoutX="10.0" layoutY="1.0" text="%address" textFill="#606060" textOverrun="CLIP">
<effect>
<ColorAdjust />
</effect>
<font>
<Font size="15.0" />
</font>
</Label>
<GridPane layoutY="31.0" prefHeight="84.0" prefWidth="963.0" AnchorPane.leftAnchor="10.0" AnchorPane.rightAnchor="10.0">
<children>
<Label text="%country" GridPane.columnIndex="0" GridPane.rowIndex="0">
<labelFor>
<AnchorPane id="countryPane" fx:id="countryAnchor" focusTraversable="true" prefHeight="19.0" prefWidth="140.0" GridPane.columnIndex="1" GridPane.rowIndex="0">
<rotationAxis>
<Point3D />
</rotationAxis>
</AnchorPane>
</labelFor>
</Label>
<fx:reference source="countryAnchor" />
<Label text="%zipCode" GridPane.columnIndex="2" GridPane.rowIndex="0">
<labelFor>
<AnchorPane fx:id="zipCodeAnchorPane" prefHeight="19.0" prefWidth="98.0" GridPane.columnIndex="3" GridPane.rowIndex="0">
<children>
<TextField fx:id="zipCodeTextField" layoutX="0.0" layoutY="0.0" onInputMethodTextChanged="#onZipCodeChanged" prefWidth="144.0" />
</children>
</AnchorPane>
</labelFor>
</Label>
<fx:reference source="zipCodeAnchorPane" />
<Label text="%city" GridPane.columnIndex="5" GridPane.rowIndex="0">
<labelFor>
<TextField id="city" fx:id="cityTextField" onInputMethodTextChanged="#onCityChanged" prefHeight="22.0" prefWidth="187.0" GridPane.columnIndex="6" GridPane.rowIndex="0" />
</labelFor>
</Label>
<fx:reference source="cityTextField" />
<Label text="%street" GridPane.columnIndex="0" GridPane.rowIndex="1">
<labelFor>
<AnchorPane fx:id="streetAnchorPane" prefHeight="19.0" prefWidth="140.0" GridPane.columnIndex="1" GridPane.rowIndex="1">
<children>
<TextField fx:id="streetTextField" layoutY="5.0" onInputMethodTextChanged="#onStreetChanged" prefWidth="200.0" />
</children>
</AnchorPane>
</labelFor>
</Label>
<fx:reference source="streetAnchorPane" />
<Label text="%number" GridPane.columnIndex="2" GridPane.rowIndex="1">
<labelFor>
<TextField id="number" fx:id="numberTextField" maxWidth="1.7976931348623157E308" minWidth="-Infinity" prefHeight="22.0" prefWidth="98.0" GridPane.columnIndex="3" GridPane.rowIndex="1" />
</labelFor>
</Label>
<fx:reference source="numberTextField" />
<Label text="%state" GridPane.columnIndex="5" GridPane.rowIndex="1">
<labelFor>
<TextField id="state" fx:id="stateTextField" prefHeight="22.0" prefWidth="187.0" GridPane.columnIndex="6" GridPane.rowIndex="1" />
</labelFor>
</Label>
<fx:reference source="stateTextField" />
<Label text="%extraInformation" GridPane.columnIndex="2" GridPane.rowIndex="2">
<labelFor>
<TextField fx:id="extraInformation" minWidth="-Infinity" prefHeight="22.0" prefWidth="427.0" GridPane.columnIndex="3" GridPane.rowIndex="2" />
</labelFor>
</Label>
<Label text="%mailboxNumber" GridPane.columnIndex="0" GridPane.rowIndex="2">
<labelFor>
<AnchorPane fx:id="mailboxNumberAnchorPane" prefHeight="19.0" prefWidth="140.0" GridPane.columnIndex="1" GridPane.rowIndex="2">
<children>
<TextField fx:id="mailBoxNumberTextField" layoutX="0.0" layoutY="6.0" prefWidth="200.0" />
</children>
</AnchorPane>
</labelFor>
</Label>
<fx:reference source="extraInformation" />
<fx:reference source="mailboxNumberAnchorPane" />
</children>
<columnConstraints>
<ColumnConstraints hgrow="SOMETIMES" maxWidth="172.0" minWidth="10.0" prefWidth="172.0" />
<ColumnConstraints hgrow="SOMETIMES" maxWidth="245.0" minWidth="10.0" prefWidth="221.0" />
<ColumnConstraints hgrow="SOMETIMES" maxWidth="196.0" minWidth="10.0" prefWidth="143.0" />
<ColumnConstraints hgrow="SOMETIMES" maxWidth="287.0" minWidth="10.0" prefWidth="144.0" />
<ColumnConstraints hgrow="SOMETIMES" maxWidth="56.0" minWidth="24.0" prefWidth="30.0" />
<ColumnConstraints hgrow="SOMETIMES" maxWidth="211.0" minWidth="10.0" prefWidth="44.0" />
<ColumnConstraints hgrow="SOMETIMES" maxWidth="291.0" minWidth="10.0" prefWidth="209.0" />
</columnConstraints>
<rowConstraints>
<RowConstraints maxHeight="30.0" minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
<RowConstraints maxHeight="30.0" minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
<RowConstraints maxHeight="30.0" minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
</rowConstraints>
</GridPane>
<GridPane fx:id="extraAnchorPane" layoutY="115.0" prefHeight="70.0" prefWidth="963.0" AnchorPane.leftAnchor="10.0" AnchorPane.rightAnchor="10.0">
<children>
<Label text="%by" GridPane.columnIndex="0" GridPane.rowIndex="0" />
<Label text="%actual" GridPane.columnIndex="0" GridPane.rowIndex="1" />
<CheckBox fx:id="stayByCheckBox" alignment="TOP_LEFT" contentDisplay="RIGHT" mnemonicParsing="false" selected="false" GridPane.columnIndex="1" GridPane.rowIndex="0" />
<CheckBox fx:id="actualCheckBox" alignment="TOP_LEFT" contentDisplay="RIGHT" mnemonicParsing="false" selected="true" GridPane.columnIndex="1" GridPane.rowIndex="1" />
<Label fx:id="recipientLabel" text="%recipient" visible="false" GridPane.columnIndex="2" GridPane.rowIndex="0" />
<TextField id="recipient" fx:id="recipientTextField" maxWidth="-Infinity" minWidth="-Infinity" prefWidth="140.0" visible="false" GridPane.columnIndex="3" GridPane.rowIndex="0" />
</children>
<columnConstraints>
<ColumnConstraints hgrow="SOMETIMES" maxWidth="184.0" minWidth="10.0" prefWidth="173.0" />
<ColumnConstraints hgrow="SOMETIMES" maxWidth="316.0" minWidth="10.0" prefWidth="220.0" />
<ColumnConstraints hgrow="SOMETIMES" maxWidth="529.0" minWidth="10.0" prefWidth="144.0" />
<ColumnConstraints hgrow="SOMETIMES" maxWidth="692.0" minWidth="10.0" prefWidth="426.0" />
<ColumnConstraints hgrow="SOMETIMES" maxWidth="486.0" minWidth="0.0" prefWidth="0.0" />
</columnConstraints>
<rowConstraints>
<RowConstraints maxHeight="30.0" minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
<RowConstraints maxHeight="30.0" minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
</rowConstraints>
</GridPane>
</children>
</fx:root>
Danke für eure Unterstützung