FileDocCategorySizeDatePackage
ScrollPaneFrame.javaAPI DocExample676Mon May 01 14:41:54 BST 2000None

ScrollPaneFrame

public class ScrollPaneFrame extends Object

Fields Summary
Constructors Summary
Methods Summary
public static voidmain(java.lang.String[] args)

    String filename = "Piazza di Spagna.jpg";
    if (args.length > 0)
      filename = args[0];

    JFrame f = new JFrame("ScrollPaneFrame v1.0");
    f.setSize(300, 300);
    f.setLocation(200, 200);
    f.addWindowListener(new WindowAdapter(  ) {
      public void windowClosing(WindowEvent e) { System.exit(0); }
    });

    Image image = Toolkit.getDefaultToolkit(  ).getImage(filename);
    f.getContentPane(  ).add(
      new JScrollPane(new ImageComponent(image)));
    f.setVisible(true);