int () { final JSplitPane splitPane = getSplitPane(); int size = splitPane.getOrientation() == JSplitPane.VERTICAL_SPLIT ? splitPane.getHeight() : splitPane.getWidth(); if (splitPane.getDividerLocation() > splitPane.getDividerSize() && splitPane.getDividerLocation() < size - splitPane.getDividerSize()) { return splitPane.getDividerLocation() + splitPane.getDividerSize() / 2; } else { return size / 2; } }