import javax.swing.*;
import java.awt.*;class ShowImage extends JFrame{
JLabel j;
JPanel top=new JPanel();
JPanel bottom=new JPanel();
JSplitPane jsp=new JSplitPane(JSplitPane.VERTICAL_SPLIT);
ShowImage(){
this.setSize(300,200);
top.setBackground(Color.blue);
bottom.setBackground(Color.red);
jsp.setDividerLocation(0.9);
jsp.setTopComponent(top);
jsp.setBottomComponent(bottom);
this.getContentPane().add(jsp);
}
public static void main(String[] args){
     new ShowImage().show();
    }
}
帮助里是说jsp.setDividerLocation可以设置Divider在jsplitpane的位置,但必须要在窗体显示之后才有效果,有没有在窗体显示前就可以定位的方法