开发者

JDesktopPane placement

开发者 https://www.devze.com 2023-03-25 05:25 出处:网络
I have a JDesktopPane and want to display JInternalFrames in a grid style without overlaying frames. The dymensions of the frames will vary so their location should be assigned dyna开发者_如何学JAVAmi

I have a JDesktopPane and want to display JInternalFrames in a grid style without overlaying frames. The dymensions of the frames will vary so their location should be assigned dyna开发者_如何学JAVAmically. I could store the coordinates of the last placed frame but frames can be moved, minimized or closed.. Is their an easy way of placing internal frames in a tidy way? e.g., using a Layout?


Here's an example that may offer some guidance. It uses setLocation() and an offset.


The DesktopManager class is responsible for managing the internal frames.

You should be able to override the openFrame() method to initially position the frame when it is added to the desktop.

There are also methods on dragging that you might be able to override to prevent the overlapping of frames.

0

精彩评论

暂无评论...
验证码 换一张
取 消