How to set default state of Drawer(JFoenix library) as closed or hidden?

670 Views Asked by At

Screenshot

I am trying to make a simple JavaFX application using the JFoenix library in which I have used the JFX Drawer and a JFX Hamburger component to make a material style side drawer as shown in the screenshot. But the problem is that the default state of the drawer is set to 'open' or 'show' whereas I want it to be hidden. I have tried the following code but this gives me a runtime error/exception :Code

Idk maybe accessing JFX components from the main java file isn't the right way but I didn't know what to do, because even in the Controller.java there was no method that ran when the application started so yeah...

And another thing! if someone knows how to set the default icon of the JFX Hamburger component to the 'back' button.

that would also work just fine. Either way I would need to know how to set default stuff from some method whenever the application runs, kind of like a main method but maybe in the Controller.java class. I know this is a very noob question but I have just started Java GUI programming, so your guys' help is really needed! Thanks in advance;)

0

There are 0 best solutions below