java.lang.Object
ij.io.OpenDialog
This class displays a dialog window from
which the user can select an input file.
-
Constructor Summary
ConstructorsConstructorDescriptionOpenDialog
(String title) Displays a file open dialog with 'title' as the title.OpenDialog
(String title, String path) Displays a file open dialog with 'title' as the title.OpenDialog
(String title, String defaultDir, String defaultName) Displays a file open dialog, using the specified default directory and file name. -
Method Summary
Modifier and TypeMethodDescriptionstatic String
Returns the current working directory as a string ending in the separator character ("/" or "\"), or an empty or null string.Returns the selected directory.Returns the selected file name.static String
Returns the path to the directory that contains the last file opened or saved, or null if a file has not been opened or saved.static String
Returns the name of the last file opened by the user using a file open or file save dialog, or using drag and drop.getPath()
Returns the selected file path or null if the dialog was canceled.static String
lookupPathVariable
(String path) static void
Sets the current working directory.static void
setLastDirectory
(String dir) Sets the path to the directory containing the last file opened by the user.static void
setLastName
(String name) Sets the name of the last file opened by the user.
-
Constructor Details
-
OpenDialog
Displays a file open dialog with 'title' as the title. -
OpenDialog
Displays a file open dialog with 'title' as the title. If 'path' is non-blank, it is used and the dialog is not displayed. Uses and updates the ImageJ default directory. -
OpenDialog
Displays a file open dialog, using the specified default directory and file name.
-
-
Method Details
-
lookupPathVariable
-
getDirectory
Returns the selected directory. -
getFileName
Returns the selected file name. -
getPath
Returns the selected file path or null if the dialog was canceled. -
getDefaultDirectory
Returns the current working directory as a string ending in the separator character ("/" or "\"), or an empty or null string. -
setDefaultDirectory
Sets the current working directory. -
getLastDirectory
Returns the path to the directory that contains the last file opened or saved, or null if a file has not been opened or saved. -
setLastDirectory
Sets the path to the directory containing the last file opened by the user. -
getLastName
Returns the name of the last file opened by the user using a file open or file save dialog, or using drag and drop. Returns null if the users has not opened a file. -
setLastName
Sets the name of the last file opened by the user.
-