Example usage for javax.swing JFileChooser CHOOSABLE_FILE_FILTER_CHANGED_PROPERTY

List of usage examples for javax.swing JFileChooser CHOOSABLE_FILE_FILTER_CHANGED_PROPERTY

Introduction

In this page you can find the example usage for javax.swing JFileChooser CHOOSABLE_FILE_FILTER_CHANGED_PROPERTY.

Prototype

String CHOOSABLE_FILE_FILTER_CHANGED_PROPERTY

To view the source code for javax.swing JFileChooser CHOOSABLE_FILE_FILTER_CHANGED_PROPERTY.

Click Source Link

Document

Identifies a change in the list of predefined file filters the user can choose from.

Usage

From source file:Main.java

public static void main(String[] argv) throws Exception {
    final JFileChooser chooser = new JFileChooser();

    chooser.addPropertyChangeListener(new PropertyChangeListener() {
        public void propertyChange(PropertyChangeEvent evt) {
            if (JFileChooser.CHOOSABLE_FILE_FILTER_CHANGED_PROPERTY.equals(evt.getPropertyName())) {
                JFileChooser chooser = (JFileChooser) evt.getSource();
                File oldDir = (File) evt.getOldValue();
                File newDir = (File) evt.getNewValue();

                File curDir = chooser.getCurrentDirectory();
            }/*from ww  w  .ja va  2  s.c o m*/
        }
    });
}