Questions tagged [fxmlloader]

310 questions
3
votes
1 answer

Access elements of loaded FXML in Parent Controller

I currently have the following situation: I have created a FXML file backed up by a FXML Controller. The screen consists of a sidebar and a child holder. When I click on an element in the sidebar, I load an additional FXML file in the child holder,…
bashoogzaad
  • 4,611
  • 8
  • 40
  • 65
3
votes
2 answers

Afterburner.fx fxml load error

I try to use Afterburner.fx for DI in my project. I take followme.fx example and I try to apply to my project. But I don't know what's wrong because I follow example but when I run app, I get these…
Marcos
  • 4,827
  • 3
  • 20
  • 28
3
votes
1 answer

leaking 'this' in constructor when using

Introduction to FXML has example how to build custom components with . Here is some snippet from the document: public CustomControl() { FXMLLoader fxmlLoader = new FXMLLoader(getClass().getResource("custom_control.fxml")); …
Venusaur
  • 191
  • 12
2
votes
1 answer

FxmlLoader.load() is not working and I have no Idea why. What should I do?

fxmlLoader.load() doesn't work; Error below. There seems to be something about an init method in the error however I have no clue what that is referring to. Windows 10; IntelliJ; SDK 11; public class HelloApplication extends Application { …
Zombkiin
  • 23
  • 4
2
votes
0 answers

List View not updating from separate FXML file JavaFX

I have an Employee ListView in MainController / Main.fxml that sits in a split pane to the left an anchorpane that loads an EmployeeController / Employee.fxml. When I add a new Employee the debugger in IntelliJ shows the added employee, but the list…
dan_jen1
  • 21
  • 4
2
votes
0 answers

How to add new fxml to scrollpane when i click button?

I want to load a new fxml to scroll pane when I click a button. RoutinesController does not work. When I click plusbtn, I want the plusaction method to add fxml to the scroll pane. I already added fxml 5 times to the scroll pane in…
lallabblla
  • 21
  • 1
2
votes
1 answer

How to extend GridPane in JavaFX to override add() is giving NPE, Scene Builder breaks

Seems like a rarely asked question, so maybe extending GridPane is the wrong approach altogether. I did look at How to extend custom JavaFX components that use FXML and more. I am trying to create a LawnGrid class that extends GridPane, the reason…
JimLohse
  • 1,209
  • 4
  • 19
  • 44
2
votes
1 answer

FXML loader can't find .fxml file in the project with modules

I have a project with such structure: I trying to load sample.fxml from the Main class using this code: Parent root = FXMLLoader.load(Main.class.getResource("../../submodule/src/java/sample.fxml")); but it doesn't work. The sample.fxml file code…
bvl
  • 161
  • 2
  • 12
2
votes
1 answer

FX 11: Controller loading in Baseclass

Injecting FXML into a derived FX Class(Controller) from the base class works - but why? The code below is actually working. But i am curious why? The FXML is loaded in the constructor of the abstract Base class (FXMLPopup) and injected to the…
kai
  • 894
  • 1
  • 7
  • 15
2
votes
1 answer

How do I load in an FXML URL for my JavaFX program?

I am currently following the Jenkov tutorial for JavaFX. He wrote the following code import javafx.application.Application; import javafx.fxml.FXMLLoader; import javafx.scene.Scene; import javafx.scene.layout.VBox; import javafx.stage.Stage; import…
Ammar Khazal
  • 133
  • 3
  • 9
2
votes
0 answers

Custom class in .fxml file doesn't get imported after obfuscation

So I successfully imported a custom class in my .fxml class as follows Everything works fine and my program works as expected. After I added pro guard to my application, the program doesn't…
2
votes
1 answer

Exception in Application start method java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

I am having trouble finding what to fix in my fxml/java code, this is the whole error: java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at…
Adrian Patiño
  • 21
  • 1
  • 1
  • 3
2
votes
0 answers

fxmlLoader.getControler return null

I'm a beginner with javafx and I'm trying for the first time to use the builder scene. I built my scene and I can display it without any problem. I applied the instructions of this post to interact with the fxml file:Accessing FXML controller…
Jhon Snow
  • 67
  • 1
  • 6
2
votes
1 answer

Getting: javafx.fxml.LoadException: No resources specified. Error

Java is telling me that they cannot find the resource to load the fxml file, but I am not sure why considering the file is literally in the same directory. I know this error may also throw if something is wrong with the fxml file; but I dont know…
wizeOnes
  • 119
  • 16
2
votes
0 answers

How can I create class instances with FXML without property getters

I have a custom class that I am using JavaFX FXML loader to create the objects. I can reproduce me problem with a simple test class with a setter for the count property: public class MyBlock { int count; public MyBlock(){ } public…
Mike davison
  • 309
  • 4
  • 17
1
2
3
20 21