Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
import java.awt.Toolkit;
import java.net.URL;
import javax.swing.ImageIcon;

public class Main {
    /**
     *
     * @param filename nom de l'image.
     * @return l'image.
     */
    public static ImageIcon lireImageIcon(final String filename) {
        URL url = Main.class.getResource("images/" + filename);
        return new ImageIcon(Toolkit.getDefaultToolkit().getImage(url));
    }
}