-4

I am new in JavaFX. I am trying to load another FXML file after successfully login:

<BorderPane id="BorderPane" maxHeight="-Infinity"
  maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity"
  prefHeight="700.0" prefWidth="1370.0" styleClass="anchor_background"
  stylesheets="@index.css" xmlns="javafx.com/javafx/8.0.141"; xmlns:fx="javafx.com/fxml/1";
  fx:controller="properties.Admin_homepageController">

It's showing error in this line:

Parent admin_homepage = FXMLLoader.load(getClass().getResource("Admin_homepage.fxml"));

The error is:

javafx.fxml.LoadException: file:/C:/Users/Arpit%20Singh/Documents/NetBeansProjects/Properties/dist/run1802424867/Properties.jar!/properties/Admin_homepage.fxml at javafx.fxml.FXMLLoader.constructLoadException(FXMLLoader.java:2601) at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:2543) at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:2441) at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:3214) at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:3175) at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:3148) at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:3124)

halfer
  • 19,824
  • 17
  • 99
  • 186
  • 2
    show the relevant parts of your code as well as the error by [edit]ing the question – luk2302 Feb 25 '18 at 12:23
  • javafx.fxml.LoadException: file:/C:/Users/Arpit%20Singh/Documents/NetBeansProjects/Properties/dist/run1802424867/Properties.jar!/properties/Admin_homepage.fxml at javafx.fxml.FXMLLoader.constructLoadException(FXMLLoader.java:2601) at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:2543) at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:2441) at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:3214) at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:3175) at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:3148) at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:3124) – Arpit Rajput Feb 25 '18 at 12:28
  • 5
    I will not help at all since I do not know javafx. This issue being urgent does not matter. And please use the [edit] functionality instead of posting the information as comments. – luk2302 Feb 25 '18 at 12:31
  • 3
    Please edit your question and provide the full stack-trace. – Edwardth Feb 25 '18 at 12:52
  • 1
    Pro tips: (1) don't beg for urgent/priority treatment, (2) always put all of the information readers need in the question itself, (3) don't ask for private tuition, email contact or support over Skype. All help is rendered in the open here, so as to benefit future readers. (4) Given you have questions -4/-1/-1, I expect you are hovering close to a question ban, so for your own sake, please read the links given to the help centre. – halfer Mar 02 '18 at 11:11

1 Answers1

0

The stack-trace contains:

javafx.fxml.LoadException:
file:/C:/Users/Arpit%20Singh/Documents/NetBeansProjects/Mulani_Properties/dist/run90454756/Mulani_Properties.jar!/mulani_properties/Admin_homepage.fxml

...

Caused by: javax.xml.stream.XMLStreamException: ParseError at [row,col]:[1,7]
Message: The processing instruction target matching "[xX][mM][lL]" is not allowed.

Now you should search for Message: The processing instruction target matching "[xX][mM][lL]" is not allowed. and find this question Error: The processing instruction target matching “[xX][mM][lL]” is not allowed.

The reason is that you have other characters before <?xml version="1.0" encoding="UTF-8"?> in Admin_homepage.fxml, remove them and put <?xml version="1.0" encoding="UTF-8"?> into the first line.

halfer
  • 19,824
  • 17
  • 99
  • 186
Edwardth
  • 697
  • 1
  • 4
  • 14
  • How to change multiple anchorpane to click on menuItem? – Arpit Rajput Feb 25 '18 at 14:31
  • How to call this type of method private void populateLead (ObservableList leadData) throws ClassNotFoundException { //Set items to the employeeTable Lead_table.setItems(leadData); } – Arpit Rajput Feb 26 '18 at 00:10