splitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT, topFrame,
bottomFrame);
splitPane.setVisible(true);
- final double ratio = topFrame.getHeight()
+ final double ratio = bottomFrame.getHeight() == 0 ? 0.5d : topFrame
+ .getHeight()
/ (double) (topFrame.getHeight() + bottomFrame.getHeight());
splitPane.setDividerLocation(ratio);
splitPane.setResizeWeight(ratio);