FileDocCategorySizeDatePackage
Starry.javaAPI DocExample2572Tue Dec 12 19:00:00 GMT 2000None

Starry

public class Starry extends JApplet

Fields Summary
static String
starryFile
Constructors Summary
Methods Summary
protected java.net.URLgetURL(java.lang.String filename)

        URL codeBase = this.getCodeBase();
        URL url = null;

        try {
            url = new URL(codeBase, filename);
        } catch (java.net.MalformedURLException e) {
            System.out.println("Couldn't create image: "
                             + "badly specified URL");
            return null;
        }

        return url;
    
public voidinit()


       
	Image starry = getImage(getURL(starryFile));
	StarPanel starPanel = new StarPanel(starry);
	getContentPane().add(starPanel, BorderLayout.CENTER);
    
public static voidmain(java.lang.String[] args)

        Image starImage = Toolkit.getDefaultToolkit().getImage(
                                        Starry.starryFile);

        StarPanel starPanel = new StarPanel(starImage);

        JFrame f = new JFrame("Starry");
        f.addWindowListener(new WindowAdapter() {
            public void windowClosing(WindowEvent e) {System.exit(0);}
        });

        f.getContentPane().add(starPanel, BorderLayout.CENTER);
        f.setSize(new Dimension(550, 200));
        f.setVisible(true);