Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

import java.io.File;

import javax.swing.Icon;
import javax.swing.ImageIcon;

import sun.awt.shell.ShellFolder;

public class Main {
    public static void main(String[] argv) throws Exception {
        File file = new File("filename.txt");
        ShellFolder sf = ShellFolder.getShellFolder(file);

        Icon icon = new ImageIcon(sf.getIcon(true), sf.getFolderType());

    }
}