读取系统图标

public class Test {
	public static void main(String[] args) {
		JFileChooser jc = new JFileChooser();
		FileSystemView view = jc.getFileSystemView();
		
		Icon icon = view.getSystemIcon(new File("D:\\user"));
	
		JFrame f = new JFrame();
		f.setSize(800, 600);
		f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		JLabel lab = new JLabel(icon);
		f.add(lab);
		
		f.setVisible(true);
	}
}

 

你可能感兴趣的:(系统)