我正在尝试将JFrame(bar)添加到JFrame(foo),这将强制bar关闭,然后foo才能再次集成。
例如,在我可以再次编写代码之前,必须关闭“About Eclipse”框架:

像这样的东西不会起作用(简化):
JFrame foo = new JFrame("Base");
JFrame bar = new JFrame("About");
foo.add(bar); // IllegalArgumentException: adding a window to a container
如何做到这一点?