From 80487948b9c2e317ad924fa2c965c0a6756f7892 Mon Sep 17 00:00:00 2001 From: malenkov Date: Tue, 27 Aug 2013 13:13:32 +0400 Subject: [PATCH] 8021379: JFileChooser Create New Folder button enabled in write proteced directory Reviewed-by: alexsch --- src/share/classes/sun/swing/FilePane.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/share/classes/sun/swing/FilePane.java b/src/share/classes/sun/swing/FilePane.java index 8dbaab55c..44aedab3d 100644 --- a/src/share/classes/sun/swing/FilePane.java +++ b/src/share/classes/sun/swing/FilePane.java @@ -1980,18 +1980,18 @@ public class FilePane extends JPanel implements PropertyChangeListener { } if (f instanceof ShellFolder) { - return ((ShellFolder) f).isFileSystem(); + return f.canWrite(); } else { if (usesShellFolder(getFileChooser())) { try { - return ShellFolder.getShellFolder(f).isFileSystem(); + return ShellFolder.getShellFolder(f).canWrite(); } catch (FileNotFoundException ex) { // File doesn't exist return false; } } else { // Ordinary file - return true; + return f.canWrite(); } } } -- GitLab