package SplitPaneTest;
import java.awt.Graphics;
import java.awt.Image;
import java.awt.Toolkit;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JSplitPane;
public class SplitPaneFrame extends JFrame {
private JSplitPane splitPane;
private Image img;
private JPanel imgPanel;
public SplitPaneFrame(){
splitPane=new JSplitPane();
splitPane.setDividerLocation(200);
splitPane.setOneTouchExpandable(true);
splitPane.setLeftComponent(new ImagePane());
add(splitPane);
pack();
}
class ImagePane extends JPanel{
public void paint(Graphics g){
img=Toolkit.getDefaultToolkit().getImage("./images/timg.jpg");
g.drawImage(img,0,0,200,300,this);
}
}
}