I am working on a MDI application. I have a headache when it comes to preventing internalframes from being dragged out ot
the JDesktopPane object. I have looked into the method setBoundsForFrame in the DefaultDesktopManager class but this is where
i get stucked. Could anyone provide an example on how to prevent the internal frames from disappearing during drag mode,
am i on the right track? So far i have no code sample to provide here to show my effort in this matter but i am working on that.
well, bad news sofar. I've tried to come up with a solution, but to no avail. I report my efforts anyway, in the hope that some more clever people than me will step in.
I added a ComponentListener to the internal frame, and with every move event I check the bounds of the internal frame whether it is still within the desktoppane. That's simple enough, but what I couldn't find is a way to detect that the dragging is over. You want to correct the bounds in that case, if that internal frame is somewhere outside the panel. I tried correcting the bounds while still dragging, but that had horrible consequences.
Well, still thinking about a way to find the moment when the dragging is over. Perhaps there is some accessible MouseListener for the title bar?
You totally ruined the moon. You're gonna hafta pay for that you know. This tiny ad agrees:
Create Edit Print & Convert PDF Using Free API with Java