public class OpenDialog
extends java.lang.Object
Constructor and Description |
---|
OpenDialog(java.lang.String title)
Displays a file open dialog with 'title' as the title.
|
OpenDialog(java.lang.String title,
java.lang.String path)
Displays a file open dialog with 'title' as
the title.
|
OpenDialog(java.lang.String title,
java.lang.String defaultDir,
java.lang.String defaultName)
Displays a file open dialog, using the specified
default directory and file name.
|
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
getDefaultDirectory()
Returns the current working directory as a string
ending in the separator character ("/" or "\"), or
an empty or null string.
|
java.lang.String |
getDirectory()
Returns the selected directory.
|
java.lang.String |
getFileName()
Returns the selected file name.
|
static java.lang.String |
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.
|
static java.lang.String |
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.
|
java.lang.String |
getPath()
Returns the selected file path or null if the dialog was canceled.
|
static java.lang.String |
lookupPathVariable(java.lang.String path) |
static void |
setDefaultDirectory(java.lang.String dir)
Sets the current working directory.
|
static void |
setLastDirectory(java.lang.String dir)
Sets the path to the directory containing the last file opened by the user.
|
static void |
setLastName(java.lang.String name)
Sets the name of the last file opened by the user.
|
public OpenDialog(java.lang.String title)
public OpenDialog(java.lang.String title, java.lang.String path)
public OpenDialog(java.lang.String title, java.lang.String defaultDir, java.lang.String defaultName)
public static java.lang.String lookupPathVariable(java.lang.String path)
public java.lang.String getDirectory()
public java.lang.String getFileName()
public java.lang.String getPath()
public static java.lang.String getDefaultDirectory()
public static void setDefaultDirectory(java.lang.String dir)
public static java.lang.String getLastDirectory()
public static void setLastDirectory(java.lang.String dir)
public static java.lang.String getLastName()
public static void setLastName(java.lang.String name)