ScrollPane with image
import javax.swing.ImageIcon; import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JScrollPane; public class ScrollPaneDemo extends JFrame { public ScrollPaneDemo() { super("JScrollPane Demo"); ImageIcon ii = new ImageIcon("largeJava2sLogo.jpg"); JScrollPane jsp = new JScrollPane(new JLabel(ii)); getContentPane().add(jsp); setSize(300, 250); setVisible(true); } public static void main(String[] args) { new ScrollPaneDemo(); } }