?? e904. listening for changes to the current directory in a jfilechooser dialog.txt
字號:
final JFileChooser chooser = new JFileChooser();
// Add listener on chooser to detect changes to current directory
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();
// The current directory should always be the same as newDir
File curDir = chooser.getCurrentDirectory();
}
}
}) ;
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -