are you using it in setting up the jsplitpane? 
in swing api, there is an explanation about this method:If the split pane is not correctly realized and on screen, this method will have no effect.please notice it.

解决方案 »

  1.   

    there are two methods to set the divider location of a splitpane. public void setDividerLocation(int location)
    public void setDividerLocation(double proportionalLocation)the first method allows user to set the EXACT location of the divider. It can be used in the initialization of the splitpane. The second one is different.it sets the divider location as a percentage of the SplitPane's size: currentPaneSize*proportinalLocation. When the splitpane is not showing on screen, its size is acutally 0. As a consequence, the divider location is also 0. So the second method is not working in the initializtion of the splitpane.
      

  2.   

    我来接分了,你呢在窗口显示之后再调整比例
    我重新写了Frame的show方法public void show() {
        super.show();
        splitPane.setDividerLocation(0.7);
     }