該函數必須在frame.setVisible(true) 之后使用才有用。
下面是官方幫助
Sets the divider location as a percentage of the JSplitPane's size.
This method is implemented in terms of setDividerLocation(int). This method immediately changes the size of the split pane based on its current size. If the split pane is not correctly realized and on screen, this method will have no effect (new divider location will become (current size * proportionalLocation) which is 0)
下面是官方幫助
Sets the divider location as a percentage of the JSplitPane's size.
This method is implemented in terms of setDividerLocation(int). This method immediately changes the size of the split pane based on its current size. If the split pane is not correctly realized and on screen, this method will have no effect (new divider location will become (current size * proportionalLocation) which is 0)