java如何在JFileChooser中显示文件的自定义图标?
如何为JFileChooser
中的文件显示自定义图标?我既不想要文件的默认系统图标,也不想要JFileChooser
附带的默认图标。我想要我自己的图标
我想按文件的扩展名设置文件的图标。我怎么能这么做
你可以在下面搜索框中键入要查询的问题!
如何为JFileChooser
中的文件显示自定义图标?我既不想要文件的默认系统图标,也不想要JFileChooser
附带的默认图标。我想要我自己的图标
我想按文件的扩展名设置文件的图标。我怎么能这么做
# 1 楼答案
我们可以使用
Hashtable
,它包含扩展名为String
类型和ImageIcon
Hashtable
在java.util
包中FileView
在javax.swing.filechooser
包中在课堂上
MyFileView
以及使用这个的代码
如果我们不想扩展,或者如果我们想为硬盘设置一个自定义图标,我的电脑,那么我们可以使用UI默认值