20
一个JPanel卸下中央元件是否有除去的任何方式Component
加入到JPanel
的CENTER
与BorderLayout
,而不必引用Component
本身?使用的BorderLayout
一个JPanel卸下中央元件是否有除去的任何方式Component
加入到JPanel
的CENTER
与BorderLayout
,而不必引用Component
本身?使用的BorderLayout
这样的事情?
BorderLayout layout = panel.getLayout();
panel.remove(layout.getLayoutComponent(BorderLayout.CENTER));
很酷。不得不修改它,但它的工作。 以这种方式使用它: myPanel.remove(layout.getLayoutComponent(BorderLayout.CENTER); – 2009-04-17 07:40:50