How do I detect completed resizing operations in JavaFX?
I have a stage, a scene and a WebView node When I expand the window to a larger size - things get very slow due to WebView What I want to do is fill the WebView with new space only when the window is resized (this is when I release the left mouse button on the resizable control / edge of the window) Now I can set the maximum value The default size for this node is - this will prevent it from expanding But how do you detect the actual events of the resizing operation completed on the window? By binding, I can verify that resizing occurs – but it is instantaneous (the properties of W & D change immediately without releasing the LMB), and I only need to perform the operation when releasing the LMB Suggestions?
I tried in event Addeventfilter is used on any's stage just to see if the event type is recognizable - unfortunately, it doesn't help
I also stumbled upon this unanswered post
Solution
This answer applies only to your application using undecorated stage
On the undecorated stage, you can handle the decoration and operation of resizing by yourself; Allows access to the right hook to handle the completion of the resize operation
For a demonstration of how to implement a resize handle for an unmodified phase, see the windowresizebutton class in the assemble sample application source code Modify this class to add a setonmousereleased handler and implement WebView size modification in it
I really want to know why this is necessary, because I don't have any slowness to adjust the slowness of the window containing WebView - maybe it's because your application uses different content in WebView than I've always used