I found this example of Internal Frames
http://docs.oracle.com/javase/tutorial/uiswing/components/internalframe.html
Is it possible to make the same internal Frames in JavaFX?
I found this example of Internal Frames
http://docs.oracle.com/javase/tutorial/uiswing/components/internalframe.html
Is it possible to make the same internal Frames in JavaFX?
With JFXtras there is a Window control, where you can add content and handle the internal window behavior.
First you will need to put in your classpath the jfxtras library. They have some instructions where you can get the library. If you are using maven, just need to add:
Or download the library and put it into your project classpath, whatever.
Now I put a sample of the demo of the Window with a little difference, allowing generation of several windows.
In the original demo, the event code was in the init method, and no button was included. I add the button to create dynamically windows and adding them to the screen.
Here is a snapshot of the result of the application:
I totally recommend you try the demo of jfxtras. They have really great stuff. Hope it helps.
You can implement simple internal window themselves. Main idea, that
InternalWindow
class just skeleton, that has internal frame like functionality. You can apply any content to it.1) Declare class
2) You should be able to set content in window
3) You should be able to bring window to front if many window exist
4) Now we need dragging functionality
5) Also we want able to resize window (I show only simple right-bottom resizing)
6) Usage. First we construct all layout. Then apply it to InternalWindow.
7) And how add window to layout
Result
Full code: gist
Upd about close button:
You can add method to InternalWindow
And when construct: