List of usage examples for java.beans PropertyChangeListener PropertyChangeListener
PropertyChangeListener
From source file:Main.java
public static void main(String[] argv) throws Exception { // Register for the event LogManager.getLogManager().addPropertyChangeListener(new PropertyChangeListener() { // This method is called when configuration file is reread public void propertyChange(PropertyChangeEvent evt) { String propName = evt.getPropertyName(); Object oldValue = evt.getOldValue(); Object newValue = evt.getOldValue(); // All values are null }/*from w w w . j a va 2 s . c om*/ }); }
From source file:Main.java
public static void main(String[] argv) throws Exception { JFileChooser chooser = new JFileChooser(); chooser.addPropertyChangeListener(new PropertyChangeListener() { public void propertyChange(PropertyChangeEvent evt) { if (JFileChooser.SELECTED_FILE_CHANGED_PROPERTY.equals(evt.getPropertyName())) { JFileChooser chooser = (JFileChooser) evt.getSource(); File oldFile = (File) evt.getOldValue(); File newFile = (File) evt.getNewValue(); File curFile = chooser.getSelectedFile(); }/* w ww.j av a2s . c o m*/ } }); }
From source file:Main.java
public static void main(String[] argv) throws Exception { JFileChooser chooser = new JFileChooser(); chooser.addPropertyChangeListener(new PropertyChangeListener() { public void propertyChange(PropertyChangeEvent evt) { if (JFileChooser.SELECTED_FILES_CHANGED_PROPERTY.equals(evt.getPropertyName())) { JFileChooser chooser = (JFileChooser) evt.getSource(); File[] oldFiles = (File[]) evt.getOldValue(); File[] newFiles = (File[]) evt.getNewValue(); // Get list of selected files File[] files = chooser.getSelectedFiles(); }/*from ww w . ja v a 2s . c om*/ } }); }
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.APPROVE_BUTTON_MNEMONIC_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 w ww .j a va2 s . co m } }); }
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.FILE_VIEW_CHANGED_PROPERTY.equals(evt.getPropertyName())) { JFileChooser chooser = (JFileChooser) evt.getSource(); File oldDir = (File) evt.getOldValue(); File newDir = (File) evt.getNewValue(); File curDir = chooser.getCurrentDirectory(); }/*w w w . j a v a2 s . co m*/ } }); }
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.SELECTED_FILE_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 w w w. j a va2s . c om } }); }
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.FILE_HIDING_CHANGED_PROPERTY.equals(evt.getPropertyName())) { JFileChooser chooser = (JFileChooser) evt.getSource(); File oldDir = (File) evt.getOldValue(); File newDir = (File) evt.getNewValue(); File curDir = chooser.getCurrentDirectory(); }/* ww w. ja v a2 s .co m*/ } }); }
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.ACCEPT_ALL_FILE_FILTER_USED_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 w w w. ja v a 2s . c o m*/ } }); }
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.APPROVE_BUTTON_TEXT_CHANGED_PROPERTY.equals(evt.getPropertyName())) { JFileChooser chooser = (JFileChooser) evt.getSource(); File oldDir = (File) evt.getOldValue(); File newDir = (File) evt.getNewValue(); File curDir = chooser.getCurrentDirectory(); }/*w w w. j a v a2s . c o m*/ } }); }
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.DIRECTORY_CHANGED_PROPERTY.equals(evt.getPropertyName())) { JFileChooser chooser = (JFileChooser) evt.getSource(); File oldDir = (File) evt.getOldValue(); File newDir = (File) evt.getNewValue(); File curDir = chooser.getCurrentDirectory(); }/*ww w. j a v a 2 s .co m*/ } }); }