也可直接将图片加载到JSplitPane的分割窗口中
package hecheng;
import javax.swing.ImageIcon;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JSplitPane;
public class t1 extends JFrame{
JPanel jp1,jp2;//声明两个JPanel面板容器
t1(){
jp1 = new JPanel();//实例
jp2 = new JPanel();//实例
JSplitPane jsp = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, jp1, jp2);//将面板容器添加到分割面板中
add(jsp);//将分割面板添加到JFrame窗体中
<