Is there any way of removing the Component
added to the CENTER
of a JPanel
with a BorderLayout
, without having to reference the Component
itself?
Something like this?
BorderLayout layout = (BorderLayout)panel.getLayout();
panel.remove(layout.getLayoutComponent(BorderLayout.CENTER));