private void updateComponents() { try { this.removeAll(); if (controller != null) { Collection<Comparable> expIds = controller.getExperimentAccs(); if (expIds == null || expIds.isEmpty()) { this.add(dataSourceTabPane, BorderLayout.CENTER); } else { JSplitPane splitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT, dataSourceTabPane, expTreeTabPane); splitPane.setOneTouchExpandable(false); splitPane.setDividerSize(0); splitPane.setResizeWeight(0.3); this.add(splitPane, BorderLayout.CENTER); } } this.revalidate(); this.repaint(); } catch (DataAccessException e) { e.printStackTrace(); // To change body of catch statement use File | Settings | File // Templates. } }