public class OpenDialog extends Object
Constructor and Description |
---|
OpenDialog(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.
|
Modifier and Type | Method and Description |
---|---|
static String |
getDefaultDirectory()
Returns the current working directory, which may be null.
|
String |
getDirectory()
Returns the selected directory.
|
String |
getFileName()
Returns the selected file name.
|
static String |
getLastDirectory()
Returns the path to the last directory opened by the user
using a file open or file save dialog, or using drag and drop.
|
static 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.
|
String |
getPath()
Returns the selected file path or null if the dialog was canceled.
|
static String |
lookupPathVariable(String path) |
static void |
setDefaultDirectory(String defaultDir)
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.
|
public OpenDialog(String title)
public OpenDialog(String title, String path)
public String getDirectory()
public String getFileName()
public String getPath()
public static String getDefaultDirectory()
public static void setDefaultDirectory(String defaultDir)
public static String getLastDirectory()
public static void setLastDirectory(String dir)
public static String getLastName()
public static void setLastName(String name)