JPanel () { final JPanel basePanel = createBasePanel(); final JPanel scrollPanel = new JPanel(new BorderLayout()); scrollPanel.add(basePanel, BorderLayout.NORTH); final JPanel advancedSettings = createAdvancedSettings(); if (advancedSettings != null) { scrollPanel.add(advancedSettings, BorderLayout.CENTER); } return scrollPanel; }