//for when the window is actually shown. It then adds a listen to store the location.
splitter.addHierarchyListener(new HierarchyListener() {
public void hierarchyChanged(HierarchyEvent e) {
if (HierarchyEvent.SHOWING_CHANGED == (e.getChangeFlags() & HierarchyEvent.SHOWING_CHANGED)) {
splitter.removeHierarchyListener(this); //we only want the first one of these, so remove ourselves as a listener.
Window window = SwingUtilities.getWindowAncestor(splitter);
if (window != null) {
Dimension dimension = window.getSize();
int halfHeight = dimension.height / 2; //we'll just make ourselves half the height of the window
splitter.setDividerLocation(halfHeight);
}
PreferencesAssistant.restoreSettings(settings, splitter, SPLITTER_PREFERENCES_ID, SinglePaneUIInstance.class);