JavaFX on JDK 8 has a shorter support timeline than JDK 8. Update releases of JDK 8 after March 2028 will not include JavaFX. Visit www.oracle.com/javase/javafx for details.
public static final class FileChooser.ExtensionFilter
extends java.lang.Object
| Constructor and Description |
|---|
ExtensionFilter(java.lang.String description,
java.util.List<java.lang.String> extensions)
Creates an
ExtensionFilter with the specified description
and the file name extensions. |
ExtensionFilter(java.lang.String description,
java.lang.String... extensions)
Creates an
ExtensionFilter with the specified description
and the file name extensions. |
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
getDescription()
Gets the description for this
ExtensionFilter. |
java.util.List<java.lang.String> |
getExtensions()
Gets the file name extensions for this
ExtensionFilter. |
public ExtensionFilter(java.lang.String description,
java.lang.String... extensions)
ExtensionFilter with the specified description
and the file name extensions.
File name extension should be specified in the *.<extension>
format.
description - the textual description for the filterextensions - the accepted file name extensionsjava.lang.NullPointerException - if the description or the extensions
are nulljava.lang.IllegalArgumentException - if the description or the extensions
are emptypublic ExtensionFilter(java.lang.String description,
java.util.List<java.lang.String> extensions)
ExtensionFilter with the specified description
and the file name extensions.
File name extension should be specified in the *.<extension>
format.
description - the textual description for the filterextensions - the accepted file name extensionsjava.lang.NullPointerException - if the description or the extensions
are nulljava.lang.IllegalArgumentException - if the description or the extensions
are emptypublic java.lang.String getDescription()
ExtensionFilter.public java.util.List<java.lang.String> getExtensions()
ExtensionFilter.
The returned list is unmodifiable and will throw
UnsupportedOperationException on each modification attempt.
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 © 2008, 2026, Oracle and/or its affiliates. All rights reserved. Use is subject to license terms. Also see the documentation redistribution policy.