Class JaxoChooseFile

java.lang.Object
net.sf.jaxodraw.gui.panel.JaxoChooseFile

public class JaxoChooseFile extends Object
Opens a file chooser dialog that is used for opening, saving and exporting files.
Since:
2.0
  • Constructor Details

    • JaxoChooseFile

      public JaxoChooseFile(Component parentc)
      Constructor.
      Parameters:
      parentc - The parent component.
    • JaxoChooseFile

      public JaxoChooseFile(Component parentc, String text)
      Constructor.
      Parameters:
      parentc - The parent component.
      text - The text to use as a dialog title.
  • Method Details

    • getComponentParent

      public final Component getComponentParent()
      Parent component for the dialog.
      Returns:
      The parent component.
    • setComponentParent

      public void setComponentParent(Component value)
      Sets the parent component.
      Parameters:
      value - The parent component.
    • getApproveText

      public final String getApproveText()
      Text for the JFileChooser approve button. Must be set.
      Returns:
      The approve button text.
    • setApproveText

      public void setApproveText(String value)
      The text for the approve button.
      Parameters:
      value - The approve button text.
    • getDialogTitle

      public final String 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

      public void setDialogTitle(String value)
      Sets the dialog title.
      Parameters:
      value - The dialog title.
    • chooseFile

      public final String chooseFile(String[] allowedExtensions, String description, String selectedFile)
      Brings up a file chooser dialog.
      Parameters:
      selectedFile - A file that should be marked as pre-selected.
      allowedExtensions - Files with these extensions (and directories) will be shown. May be 'null' indication no filtering.
      description - A description of this dialog.
      Returns:
      A string with the absolute path of the chosen file, or an empty string, if no file was selected.