重新实例化 GUI (JFrame) 对象
基本上我希望我的 JFrame 在事件触发时成为一个全新的 JFrame 对象。我有一些代码基本上调用 GUI gui = new GUI(x, y)
我遇到的唯一问题是,除了创建新的 GUI 对象外,它并没有删除旧窗口。谁能告诉我如何摆脱旧窗户。
谢谢。
basically I want my JFrame to become a completely new JFrame object when an event is triggered. I have some code that basically calls GUI gui = new GUI(x, y)
the only problem I'm having is that as well as creating the new GUI object, it is not deleting the old window. Can anyone tell me how to get rid of the old window.
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我相信您需要致电
I believe you need to call dispose on the existing JFrame first to free it up immediately.