展开全部
java可使用FileSystemView和ShellFolder类获取文件的小图标32313133353236313431303231363533e59b9ee7ad9431333337396235和大图标,以下是详细代码:import java.awt.FlowLayout;
import java.io.File;
import java.io.FileNotFoundException;
import javax.swing.Icon;
import javax.swing.ImageIcon;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.filechooser.FileSystemView;
public class GetFileIcon {
/**
* @param args
*/
public static void main( String[] args )
{
String filePath = "D:/sheet1.xlsx";
File f = new File( filePath );
JFrame frm = new JFrame();
frm.setSize( 300, 200 );
frm.setLocationRelativeTo( null );
frm.setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE );
frm.setVisible( true );
frm