1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Tutorial JavaFX for Beginners

Discussion in 'Tutorials & Resources' started by Baddest Man on Earth, Jan 18, 2015.

  1. TheVTM

    Joined:
    Mar 29, 2016
    Messages:
    54
    Likes Received:
    7
    My controller was not getting used even after calling setController.

    Changing this
    Code (Text):
    1. // Load fxml file
    2. FXMLLoader fxmlLoader = new FXMLLoader();
    3. fxmlLoader.setController(new GUIController(script, this));
    4. final Parent root = fxmlLoader.load(getClass().getResource("sample.fxml"));
    to this
    Code (Text):
    1. // Load fxml file
    2. FXMLLoader fxmlLoader = new FXMLLoader(getClass().getResource("sample.fxml"));
    3. fxmlLoader.setController(new GUIController(script, this));
    4. final Parent root = fxmlLoader.load();
    solved the problem.
     
  2. awesome123man

    awesome123man Go check out new bots and give helpful feedback.

    Joined:
    Jan 31, 2016
    Messages:
    5,413
    Likes Received:
    1,662
    @Akatsuki, I am having the same problem, where do i implement this and how?
     
  3. Salvation

    Salvation First Bot Author

    Joined:
    Aug 7, 2013
    Messages:
    262
    Likes Received:
    68
    I would recommend Scene Builder - Gluon instead of the Oracle Scene Builder, as this one is much more up to date. Alternatively, you could download the source of Oracle's Scene Builder and compile everything yourself, but why would you.

    Edit: oh, someone already mentioned it.
     
    Baddest Man on Earth and Arbiter like this.
  4. Baddest Man on Earth

    Joined:
    Nov 26, 2014
    Messages:
    616
    Likes Received:
    246
    I'm probably going to remake this for the Spectre UI, thanks for the link, it looks way better than vanilla Scene Builder.
     
  5. Rumb

    Joined:
    Jan 3, 2021
    Messages:
    9
    Likes Received:
    6
    Ridz and RReluent like this.

Share This Page

Loading...