How close fxml window by controller?
2 posts
• Page 1 of 1
Re: How close fxml window by controller?
That depends, would you like to reuse the window or not?
Frames and InternalFrames are "opened" by simply setting them to visible:
Analogues, closing them means to set the them simply invisible:
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:
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.
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.
-
rzenz - Posts: 36
- Joined: Mon Dec 12, 2016 1:40 pm
- Location: Vienna, Austria
Re: How close fxml window by controller?
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.
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.
-
rzenz - Posts: 36
- Joined: Mon Dec 12, 2016 1:40 pm
- Location: Vienna, Austria
2 posts
• Page 1 of 1