public abstract class FileView extends Object
FileView
定义一个抽象类,可以实现提供档案选择程式为
File
UI信息。每个L和F
JFileChooserUI
对象实现这类传递回正确的图标和描述特定类型,L和F为例,微软Windows L和F返回通用的Windows图标的目录和文件类型。此外,你可能想去
JFileChooser
返回不同的图标或使用
JFileChooser.setFileView(javax.swing.filechooser.FileView)
附加信息提供自己的
FileView
。
JFileChooser
首先看如果有一个用户定义的FileView
,如果有,它从那里首先得到类型信息。如果FileView
返回null
任何方法,JFileChooser
利用L和F特定视图得到的信息。所以,例如,如果你提供一个FileView
类返回一个Icon
jpg文件,并返回null
图标的所有其他文件,用户界面的FileView
将所有其他文件所提供的默认图标。
对于一个简单的文件视图实例的实现,看到yourJDK/demo/jfc/FileChooserDemo/ExampleFileView.java
。更多的信息和例子见How to Use File Choosers,java教程中的一部分。
JFileChooser
Constructor and Description |
---|
FileView() |
Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2014, Oracle and/or its affiliates. All rights reserved.