JFrame附加在另一个JFrame的侧面 [英] JFrame attached on the side of another JFrame

查看:51
本文介绍了JFrame附加在另一个JFrame的侧面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将一个JFrame附加到另一个JFrame,它通过将第二个jframe的坐标设置为第一个jframe的右侧来工作.但这感觉并不完整,因为当我拖动第一个JFrame时,第二个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. But it doesn't feel like one whole because when I drag the first JFrame the second one lags behind it like a dog.

拖动时有什么方法可以防止它们分离,所以看起来更像一个整体吗?

Is there any way to keep them from seperating when you drag it, so it looks more like one whole?

推荐答案

由于主机的重量级对等组件拥有该框架,因此以跨平台的方式很难做到这一点.在Mac OS X上,您可能会考虑绑定到 可可抽屉和披露 . MacWidgets 项目可能包含有用的示例.另请参见 Q& A .

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. The MacWidgets project may have useful examples. See also this Q&A.

这篇关于JFrame附加在另一个JFrame的侧面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆