This website uses cookies for visitor traffic analysis. By using the website, you agree with storing the cookies on your computer.More information

How close fxml window by controller?

General questions regarding the development with JavaFX UI for JVx.

Re: How close fxml window by controller?

Postby rzenz » Tue Oct 31, 2017 5:19 pm

That depends, would you like to reuse the window or not?

Frames and InternalFrames are "opened" by simply setting them to visible:

Code: Select all
internalFrame.setVisible(true);


Analogues, closing them means to set the them simply invisible:

Code: Select all
internalFrame.setVisible(false);


This also allows to easily keep using and reuse Frames and InternalFrames, because the container itself is actually not destroyed. One can still access all the components which have been added to the Frame or InternalFrame.

If one wants to actually "destroy" the Frame or InternalFrame, without the ability to reuse it, that can also be done:

Code: Select all
internalFrame.dispose();


Note that there is the isDisposed() method which can be used to determine whether a Frame or InternalFrame has already been disposed. A disposed Frame or InternalFrame should not be reused.
User avatar
rzenz
 
Posts: 36
Joined: Mon Dec 12, 2016 1:40 pm
Location: Vienna, Austria

Re: How close fxml window by controller?

Postby rzenz » Tue Oct 31, 2017 5:54 pm

There is no way to access the GenUI layer from the Technology layer, because the Technology layer does know nothing about the GenUI layer (and neither does it care, for that matter).

Given that you must create your controller beforehand (like in the example from your previous question), you can simply give the InternalFrame instance to your controller, for example as parameter in the constructor.
User avatar
rzenz
 
Posts: 36
Joined: Mon Dec 12, 2016 1:40 pm
Location: Vienna, Austria


Return to Development