?? e900. displaying the current directory in the title of a jfilechooser dialog.txt
字號:
This example displays the complete path of the current directory in the title whenever the current directory changes.
final JFileChooser chooser = new JFileChooser();
// Initialize title with current directory
File curDir = chooser.getCurrentDirectory();
chooser.setDialogTitle(""+curDir.getAbsolutePath());
// 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())) {
File curDir = chooser.getCurrentDirectory();
chooser.setDialogTitle(""+curDir.getAbsolutePath());
}
}
}) ;
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -