Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8578891
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T20:29:46+00:00 2026-06-11T20:29:46+00:00

I am currently working on an administrator build in java FX 2.1 using netbeans

  • 0

I am currently working on an administrator build in java FX 2.1 using netbeans 7.2

I have the following issues:

I am developing this particular tool in an MVC pattern, so I’ve created 3 packages called Model, view and Controller.

My problem is that when building the project in netbeans it would only read the files supposed to be in the view package if they’re outside of it. Let me give you a context path:

.../administradorInfinix/view/
.../administradorInfinix/controller/
.../administradorInfinix/model

so it would only read the fxml files regarding the view if they are outside the view package (.../administradorInfinix/)

This is where I set the address of the file:

    private void irInicioSesion() {
    try {
        replaceSceneContent("InicioSesion.fxml");
    } catch (Exception ex) {
        Logger.getLogger(AdministradorINFINIX.class.getName()).log(Level.SEVERE, null, ex);
    }
}

You can see the file name is InicioSesion.fxml, which should be inside the view package but it won’t load if this is the case.

This is the replaceSceneContent I’m using to search for the fxml files:

private Parent replaceSceneContent(String fxml) throws Exception {
    Parent page = (Parent) FXMLLoader.load(AdministradorINFINIX.class.getResource(fxml), null, new JavaFXBuilderFactory());
    Scene scene = stage.getScene();
    if (scene == null) {
        scene = new Scene(page,548,416);
        //scene.getStylesheets().add(AdministradorINFINIX.class.getResource("demo.css").toExternalForm());
        stage.setScene(scene);
    } else {
        stage.getScene().setRoot(page);
    }
    stage.sizeToScene();
    return page;
}

And this is the error it gives me when trying to run (it builds just fine but it won’t run)

> administradorinfinix.AdministradorINFINIX irInicioSesion
Grave: null
java.lang.IllegalStateException: Location is not set.
    at javafx.fxml.FXMLLoader.load(Unknown Source)
    at javafx.fxml.FXMLLoader.load(Unknown Source)
    at javafx.fxml.FXMLLoader.load(Unknown Source)
    at javafx.fxml.FXMLLoader.load(Unknown Source)
    at administradorinfinix.AdministradorINFINIX.replaceSceneContent(AdministradorINFINIX.java:126)
    at administradorinfinix.AdministradorINFINIX.irInicioSesion(AdministradorINFINIX.java:110)
    at administradorinfinix.AdministradorINFINIX.start(AdministradorINFINIX.java:46)
    at com.sun.javafx.application.LauncherImpl$5.run(Unknown Source)
    at com.sun.javafx.application.PlatformImpl$4.run(Unknown Source)
    at com.sun.javafx.application.PlatformImpl$3.run(Unknown Source)
    at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
    at com.sun.glass.ui.win.WinApplication.access$100(Unknown Source)
    at com.sun.glass.ui.win.WinApplication$2$1.run(Unknown Source)
    at java.lang.Thread.run(Thread.java:722)

where line 110 is

  replaceSceneContent("InicioSesion.fxml");

and line 126 is

Parent page = (Parent) FXMLLoader.load(AdministradorINFINIX.class.getResource(fxml), null, new JavaFXBuilderFactory());

I hope you can help me fix this problem.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T20:29:48+00:00Added an answer on June 11, 2026 at 8:29 pm

    You need to call the method FXMLLoader#setLocation with the URL of the FXML file. Have a look at the following source for an example of how to load FXML files:

    https://github.com/cathive/fx-guice/blob/master/src/main/java/com/cathive/fx/guice/GuiceFXMLLoader.java

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm currently working on a web application using Spring MVC, and I use the
Currently working with the following package structure: /package __init__.py final.py /write __init__.py write.py /data
I am currently working on a project where I have several string that may
I am currently developing an application in C# (.NET 4.0) that should have as
I have correctly implemented authentication on an MVC application I have been working on
A project I'm working on currently involves using a disparate set of technologies, including
I'm currently working with Apache and SVN with ActiveDirectory Authentication. The user is using
Being a Windows developer I'm currently working on my own project using LAMP. I
I have authlogic working fine but now have the need to let administrator users
I am currently working on administrator module as m new to asp.net i am

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.