Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我找不到简单答案的简单问题:
我有一个JPanel充满了不同的组件。如果我执行以下操作
JPanel
JPanel panel = new JPanel(); //Code to add componenets to the panel. panel.setLayout(new MigLayout("wrap 5"); panel.removeAll();
这是否也删除了布局管理器?还是只是移除了组件?
最好的问候,山羊猫
文档说
从此容器中移除所有组件。此方法还通过 removeLayoutComponent 方法通知布局管理器从该容器的布局中删除组件。 此方法更改与布局相关的信息,因此使组件层次结构无效。如果容器已显示,则必须随后验证层次结构以反映更改。
从此容器中移除所有组件。此方法还通过 removeLayoutComponent 方法通知布局管理器从该容器的布局中删除组件。
此方法更改与布局相关的信息,因此使组件层次结构无效。如果容器已显示,则必须随后验证层次结构以反映更改。