X-Git-Url: http://git.nikiroo.be/?a=blobdiff_plain;f=src%2Fjexer%2FTFileOpenBox.java;h=a2cc0cf7e48f2e68efebfefec3c66d14775796c9;hb=f19b48e27a56ebab18687debd9ef52581a03f06d;hp=ac23cfd13557e58100bee15a9a878ecb55157b6d;hpb=a69ed767c9c07cf35cf1c5f7821fc009cfe79cd2;p=fanfix.git diff --git a/src/jexer/TFileOpenBox.java b/src/jexer/TFileOpenBox.java index ac23cfd..a2cc0cf 100644 --- a/src/jexer/TFileOpenBox.java +++ b/src/jexer/TFileOpenBox.java @@ -47,7 +47,7 @@ import static jexer.TKeypress.*; * *
* {@code - * filename = application.fileOpenBox("/path/to/file.ext", + * filename = fileOpenBox("/path/to/file.ext", * TFileOpenBox.Type.OPEN); * if (filename != null) { * ... the user selected a file, go open it ... @@ -185,6 +185,7 @@ public class TFileOpenBox extends TWindow { File selectedDir = ((TDirectoryTreeItem) item).getFile(); try { directoryList.setPath(selectedDir.getCanonicalPath()); + entryField.setText(selectedDir.getCanonicalPath()); if (type == Type.OPEN) { openButton.setEnabled(false); } @@ -391,7 +392,7 @@ public class TFileOpenBox extends TWindow { private void checkFilename(final String newFilename) throws IOException { File newFile = new File(newFilename); if (newFile.exists()) { - if (newFile.isFile()) { + if (newFile.isFile() || (type == Type.SELECT)) { filename = newFilename; getApplication().closeWindow(this); return;