简体   繁体   English

JFrame附加在另一个JFrame的侧面

[英]JFrame attached on the side of another JFrame

I'm trying to attach a JFrame to another JFrame, it works by setting the coordinates of the 2nd jframe to the right edge of the first. 我正在尝试将一个JFrame附加到另一个JFrame,它通过将第二个jframe的坐标设置为第一个jframe的右侧来工作。 But it doesn't feel like one whole because when I drag the first JFrame the second one lags behind it like a dog. 但这感觉并不完整,因为当我拖动第一个JFrame时,第二个JFrame像狗一样落后于它。

Is there any way to keep them from seperating when you drag it, so it looks more like one whole? 有什么方法可以防止它们在拖动时分离,因此看起来更像一个整体?

jframes

Because the host's heavyweight peer component owns the frame, this will be difficult to do in a cross-platorm manner. 因为主机的重量级对等组件拥有该框架,所以以跨平台的方式很难做到这一点。 On Mac OS X, you might look at binding to Cocoa Drawers and Disclosure . 在Mac OS X上,您可能会考虑绑定到Cocoa Drawers and Disclosure The MacWidgets project may have useful examples. MacWidgets项目可能包含有用的示例。 See also this Q&A . 另请参阅此问答

尝试使用JSplitPaneJInternalFrameJInternalFrame提供本机框架的许多功能。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM