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.java19
1 files changed, 16 insertions, 3 deletions
diff --git a/libjava/classpath/javax/swing/plaf/basic/BasicFileChooserUI.java b/libjava/classpath/javax/swing/plaf/basic/BasicFileChooserUI.java
index 30e3156b4e0..daa97708390 100644
--- a/libjava/classpath/javax/swing/plaf/basic/BasicFileChooserUI.java
+++ b/libjava/classpath/javax/swing/plaf/basic/BasicFileChooserUI.java
@@ -157,6 +157,21 @@ public class BasicFileChooserUI extends FileChooserUI
closeDialog();
}
}
+ else
+ {
+ File f = new File(filechooser.getCurrentDirectory(), getFileName());
+ if (filechooser.isTraversable(f))
+ {
+ filechooser.setCurrentDirectory(f);
+ filechooser.rescanCurrentDirectory();
+ }
+ else
+ {
+ filechooser.setSelectedFile(f);
+ filechooser.approveSelection();
+ closeDialog();
+ }
+ }
}
}
@@ -1046,9 +1061,7 @@ public class BasicFileChooserUI extends FileChooserUI
*/
public String getFileName()
{
- // FIXME: I'm thinking that this method just provides access to the
- // text value in the JTextField component...but not sure yet
- return null; //filename;
+ return entry.getText();
}
/**
OpenPOWER on IntegriCloud