Can you hide the divider of a split pane ?

I have a split pane, the application also has menu options that allow the user to turn off one of the panes if they like, this results in the pane disappearing but the splitpane divider still exists.

Can this be removed, and if not is it acceptable look for the divider to exist when only one side of the splitpane is visible, or do I have to remove the splitpane from its parent and just add the visible component of the splitpane to the parent directly when only one is selected, reversing the code when user wishes to have both visible.

[553 byte] By [paultaylora] at [2007-10-3 10:32:47]
# 1
BasicSplitPaneUI ui = (BasicSplitPaneUI)splitPane.getUI();ui.getDivider().setVisible(false);
camickra at 2007-7-15 5:55:49 > top of Java-index,Desktop,Core GUI APIs...
# 2
Thanks that works fine. Although it is a shame there is no splitpane.getDivider() method, I assume there is no explicit guarantee that the LAF being used actually subclasses BasicSplitPaneUI, so I need to make appropriate checks.
paultaylora at 2007-7-15 5:55:49 > top of Java-index,Desktop,Core GUI APIs...