像这样吗?
BorderLayout layout = panel.getLayout(); panel.remove(layout.getLayoutComponent(BorderLayout.CENTER));