简体   繁体   English

JFrame中的JFrame

[英]JFrame inside a JFrame

Why is it impossible to add JFrame to a JFrame? 为什么不可能将JFrame添加到JFrame? It's just adding a Component to a Container. 它只是向容器添加一个组件。 How Java prohibits me from doing so? Java如何禁止我这样做? Yes, I know doing it doesn't make sense, but the point of my question is to understand Swing mechanism - how it works under the hood. 是的,我知道这样做是没有意义的,但是我的问题的重点是了解Swing机制-它是如何在后台运行的。

JFrame is a top-level container and is therefore compareable to the root element of a XML file. JFrame是顶级容器,因此可以与XML文件的根元素进行比较。 The specification allows only one of them. 该规范仅允许其中之一。

JFrame can add JInternalFrame not same lick JFrame The JFrame class is incompatible with Frame. JFrame可以添加JInternalFrame而不是舔JFrame JFrame类与Frame不兼容。 JInternalFrame is very similar to setting up the GUI for a JFrame. JInternalFrame与为JFrame设置GUI非常相似。 JInternalFrame also provides other API, such as pack, that makes it similar to JFrame. JInternalFrame还提供其他API(例如pack),使其类似于JFrame。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM