Question JavaFX/GUI Help

Discussion in 'Developer Support' started by Scourge, Nov 9, 2015.

  1. Hi, so I've followed this tutorial, but it throws a file not found exception though I am positive it is right?

    Code (Text):
    1. (07:42:29) java.io.FileNotFoundException: \bots\stressSplasher\GUI.fxml (The system cannot find the path specified)
    and my file path (excuse the poorly structured folders):
    [​IMG]

    The GUI still pops up, but it is way too big and nothing is on it.

    As well, my other question; I have a ComboBox populated with 3 spells, how would I set what spell to cast to a variable in the main class?
    -> Select spell > send to main class to set the variable > start script bot > cast spell > repeat cast > etc
     
  2. What does the //Load the fxml file code look like in your program?
    /com/scourge/bots/stressSplasher/GUI.fxml maybe?
     
  3. I have tried that path as well. It's currently:
    Code (Text):
    1.  final Parent root = loader.load(StressSplasher.class.getResourceAsStream("/bots/stressSplasher/GUI.fxml"));  
     
  4. Code (Text):
    1. final Parent root = loader.load(getClass().getResource("/bots/stressSplasher/GUI.fxml");
    or "/com/scourge/bots/stressSplasher/GUI.fxml"
    I've not used xml only css for javaFX so maybe try this? Sorry I couldn't help if this doesn't work.
     
  5. Tried that as well. :c Thanks though.
     
    #5 Scourge, Nov 10, 2015
    Last edited: Nov 10, 2015

Share This Page

Loading...