Java - 同一窗口上的另一个 JFrame
我想要的是创建一个新的 JFrame,保持当前的 JFrame 可见,但不创建新的窗口/程序。我无法很好地解释它,所以这是我的意思的图片:
http://screensnapr.com /e/mkCMlm.png
抱歉,如果这有任何令人困惑的地方。任何帮助表示赞赏。
What I want is to make a new JFrame, keeping my current JFrame visible, but not create a new window/program. I can't explain it well, so here is a picture of what I mean:
http://screensnapr.com/e/mkCMlm.png
Sorry if this is confusing in any way. Any help is appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以尝试 http://docs.oracle.com/javase/tutorial/ uiswing/components/internalframe.html
另外,您可以尝试在新窗口中使用对话框而不是框架。
You can try http://docs.oracle.com/javase/tutorial/uiswing/components/internalframe.html
Also you can try to use a dialog rather than frame for the new window.
如果我理解正确的话,您需要 JInternalFrame,它是 swing 中的一个特殊组件,位于名为 Desktop 的容器内。因此,如果您想要有这样的行为:
您肯定需要在 JFrame 中有一个名为JDesktopPane,那么你可以在这个容器中添加JInternalFrame,如下所示:
有关更多信息,您可以查看官方oracle文档或Java2SE 代码示例
If I understood correctly you want JInternalFrame which are a special component in swing that live inside a Container named Desktop. So if you want to have a behaviour like this:
You definitely need to have inside your JFrame a container named JDesktopPane, then you can add JInternalFrame inside this container like this:
For more information you can see official oracle documentation or Java2SE code samples