@Test public void testHideSplit() { SplittablePane splitPane; splitPane= new SplittablePane(SplittablePane.HORIZONTAL_SPLIT, main, secondary); splitPane.setSize(200, 100); content.add(splitPane, BorderLayout.CENTER); content.doLayout(); assertTrue(!splitPane.isSplit()); splitPane.showSplit(); assertTrue(splitPane.isSplit()); splitPane.hideSplit(); assertTrue(!splitPane.isSplit()); splitPane.hideSplit(); assertTrue(!splitPane.isSplit()); }
public void hideSplit() { if (isSplit) { dividerLocation = splitPane.getDividerLocation(); remove(splitPane); splitPane.remove(mainComponent); add(mainComponent, BorderLayout.CENTER); isSplit = false; validate(); } }
SplittablePane extends JPanel { public void hideSplit() { if (isSplit) { dividerLocation = splitPane.getDividerLocation(); remove(splitPane); splitPane.remove(mainComponent); add(mainComponent, BorderLayout.CENTER); isSplit = false; validate(); } } }
SplittablePane extends JPanel { public void hideSplit() { if (isSplit) { dividerLocation = splitPane.getDividerLocation(); remove(splitPane); splitPane.remove(mainComponent); add(mainComponent, BorderLayout.CENTER); isSplit = false; validate(); } } SplittablePane();  SplittablePane(int orientation, Component mainComponent);  SplittablePane(int orientation, Component mainComponent, Component secondaryComponent); }
SplittablePane extends JPanel { public void hideSplit() { if (isSplit) { dividerLocation = splitPane.getDividerLocation(); remove(splitPane); splitPane.remove(mainComponent); add(mainComponent, BorderLayout.CENTER); isSplit = false; validate(); } } SplittablePane();  SplittablePane(int orientation, Component mainComponent);  SplittablePane(int orientation, Component mainComponent, Component secondaryComponent); void setMainComponent(Component component); void setSecondaryComponent(Component secondaryComponent); void hideSplit(); void showSplit(); void saveDividerLocation(); boolean isSplit(); Component getMainComponent(); Component getSecondaryComponent(); void setDividerFraction(double fraction); double getDividerFraction(); @Override void setSize(int width, int height); }
SplittablePane extends JPanel { public void hideSplit() { if (isSplit) { dividerLocation = splitPane.getDividerLocation(); remove(splitPane); splitPane.remove(mainComponent); add(mainComponent, BorderLayout.CENTER); isSplit = false; validate(); } } SplittablePane();  SplittablePane(int orientation, Component mainComponent);  SplittablePane(int orientation, Component mainComponent, Component secondaryComponent); void setMainComponent(Component component); void setSecondaryComponent(Component secondaryComponent); void hideSplit(); void showSplit(); void saveDividerLocation(); boolean isSplit(); Component getMainComponent(); Component getSecondaryComponent(); void setDividerFraction(double fraction); double getDividerFraction(); @Override void setSize(int width, int height); static final int HORIZONTAL_SPLIT; static final int VERTICAL_SPLIT; static final double DEFAULT_DIVIDER_LOCATION; }