Class JaxoChooseFile
java.lang.Object
net.sf.jaxodraw.gui.panel.JaxoChooseFile
Opens a file chooser dialog that is used for opening, saving and exporting
files.
- Since:
- 2.0
-
Constructor Summary
ConstructorsConstructorDescriptionJaxoChooseFile(Component parentc) Constructor.JaxoChooseFile(Component parentc, String text) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionfinal StringchooseFile(String[] allowedExtensions, String description, String selectedFile) Brings up a file chooser dialog.final StringText for the JFileChooser approve button.final ComponentParent component for the dialog.final StringTitle to be used for dialogs.voidsetApproveText(String value) The text for the approve button.voidsetComponentParent(Component value) Sets the parent component.voidsetDialogTitle(String value) Sets the dialog title.
-
Constructor Details
-
JaxoChooseFile
-
JaxoChooseFile
-
-
Method Details
-
getComponentParent
Parent component for the dialog.- Returns:
- The parent component.
-
setComponentParent
Sets the parent component.- Parameters:
value- The parent component.
-
getApproveText
Text for the JFileChooser approve button. Must be set.- Returns:
- The approve button text.
-
setApproveText
The text for the approve button.- Parameters:
value- The approve button text.
-
getDialogTitle
Title to be used for dialogs. If 'null' (the default), a default will be created using the approve text, but this is typically inferior to setting a custom one.- Returns:
- The dialog title.
-
setDialogTitle
Sets the dialog title.- Parameters:
value- The dialog title.
-
chooseFile
Brings up a file chooser dialog.- Parameters:
allowedExtensions- Files with these extensions (and directories) will be shown. May be 'null' indication no filtering.description- A description of this dialog.selectedFile- A file that should be marked as pre-selected.- Returns:
- A string with the absolute path of the chosen file, or an empty string, if no file was selected.
-