summaryrefslogtreecommitdiffstats
path: root/libjava/classpath/javax/swing/plaf/basic/BasicFileChooserUI.java
diff options
context:
space:
mode:
Diffstat (limited to 'libjava/classpath/javax/swing/plaf/basic/BasicFileChooserUI.java')
-rw-r--r--libjava/classpath/javax/swing/plaf/basic/BasicFileChooserUI.java10
1 files changed, 5 insertions, 5 deletions
diff --git a/libjava/classpath/javax/swing/plaf/basic/BasicFileChooserUI.java b/libjava/classpath/javax/swing/plaf/basic/BasicFileChooserUI.java
index dc1c051225c..e1f8e4b28ba 100644
--- a/libjava/classpath/javax/swing/plaf/basic/BasicFileChooserUI.java
+++ b/libjava/classpath/javax/swing/plaf/basic/BasicFileChooserUI.java
@@ -183,7 +183,7 @@ public class BasicFileChooserUI extends FileChooserUI
protected class BasicFileView extends FileView
{
/** Storage for cached icons. */
- protected Hashtable iconCache = new Hashtable();
+ protected Hashtable<File, Icon> iconCache = new Hashtable<File, Icon>();
/**
* Creates a new instance.
@@ -444,10 +444,10 @@ public class BasicFileChooserUI extends FileChooserUI
setDirectory(null);
}
lastSelected = path;
- parentPath = path.substring(0, path.lastIndexOf("/") + 1);
+ parentPath = f.getParent();
if (f.isFile())
- setFileName(path.substring(path.lastIndexOf("/") + 1));
+ setFileName(f.getName());
else if (filechooser.getFileSelectionMode() !=
JFileChooser.FILES_ONLY)
setFileName(path);
@@ -827,9 +827,9 @@ public class BasicFileChooserUI extends FileChooserUI
installComponents(fc);
installListeners(fc);
- Object path = filechooser.getCurrentDirectory();
+ File path = filechooser.getCurrentDirectory();
if (path != null)
- parentPath = path.toString().substring(path.toString().lastIndexOf("/"));
+ parentPath = path.getParent();
}
}
OpenPOWER on IntegriCloud