如何在 Swing 中将一个窗口停靠到另一个窗口?
我打开了两个 JFrame
。我让窗口 B 在窗口 A 的右侧生成,紧贴窗口 A 的右边缘。我希望它粘在窗口 A 上并随窗口 A 一起移动。我怎样才能让它做到这一点?
I have two JFrame
s open. I have window B spawn to the right of window A, snugged up to window A's right edge. I want it to stick to and move with window A. How can I make it do this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我创建了一个名为 DockingManager 的类,它可以让您停靠伪 Winamp 风格的对话框和框架,
它还可以让您创建不同的集群并设置磁性级别来选择哪个框架拖动其他框架)
I made a class called DockingManager that lets you dock Dialogs and Frames pseudo Winamp Style
It also lets you make different clusters and set magnetic levels to choose which frame drags the others)
尝试 JInternalFrame!
有关更多信息,请参见 http://download.oracle.com/javase/tutorial /uiswing/components/internalframe.html
try JInternalFrame!
For more look at http://download.oracle.com/javase/tutorial/uiswing/components/internalframe.html