Noel actually implemented this, but here are my thoughts:
this works :-) , but executing the test application i get a strange
thing:
on the horizontal axis if i resize too much (for example to the right
side), the right size doesn't go outside the screen but the left yes
(as seen in the attached screenshot). In the vertical axis all is good
(none outside screen).
It depends on where the window is on the screen when you resize it. If
the window was positioned exactly in the middle of the screen, I
imagine that the left side would also remain on the screen.
And if i re-open the sheet is has the same dimensions of last resize
... this is wanted ?
I would think so. If an app doesn't want this behavior, it can call
setPreferredSize(-1, -1) before re-opening the window.