Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

import java.awt.Image;
import java.net.URL;
import java.util.ArrayList;
import java.util.List;

import javax.imageio.ImageIO;
import javax.swing.JFrame;

public class Main {

    public static void main(String[] args) throws Exception {
        URL url16 = new URL("http://www.java2s.com/style/download.png");
        URL url32 = new URL("http://www.java2s.com/style/download.png");

        final List<Image> icons = new ArrayList<Image>();
        icons.add(ImageIO.read(url16));
        icons.add(ImageIO.read(url32));

        JFrame f = new JFrame();
        f.setIconImages(icons);
        f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

        f.setSize(200, 100);
        f.setVisible(true);
    }
}