| Modifier and Type | Field and Description |
|---|---|
| private static final JFileChooser | |
| private final Component |
| Access | Constructor and Description |
|---|---|
| public | FileOpenSaveDialog(Component
the main UI (JFrame) on top of which File open/save dialog should open. parentUI, FileFilter file Filter, null is allowed when no filter is applicable. fileFilter)Constructor. |
| Modifier and Type | Method and Description |
|---|---|
| public File | |
| public boolean | Returns: true if the file is saved successfully or false if failed.document to be saved in a .pdf file. document, String file extension. extension)Saves document into a .pdf file after the user is prompted to choose the destination. |
| public boolean |
| FILE_CHOOSER | back to summary |
|---|---|
| private static final JFileChooser FILE_CHOOSER | |
| mainUI | back to summary |
|---|---|
| private final Component mainUI | |
| FileOpenSaveDialog | back to summary |
|---|---|
| public FileOpenSaveDialog(Component parentUI, FileFilter fileFilter) Constructor.
| |
| openFile | back to summary |
|---|---|
| public File openFile() throws IOException open a file prompting user to select the file.
| |
| saveDocument | back to summary |
|---|---|
| public boolean saveDocument(PDDocument document, String extension) throws IOException Saves document into a .pdf file after the user is prompted to choose the destination.
| |
| saveFile | back to summary |
|---|---|
| public boolean saveFile(byte[] bytes, String extension) throws IOException Saves data into a file after the user is prompted to choose the destination.
| |