Skip to content

Commit

Permalink
Fix Export Bug and Automatically Close JDialog
Browse files Browse the repository at this point in the history
Fix the bug that raised a null error whenever an export did not go through, and made the JDialog automatically close whenever the user opens a remote file making for a smoother experience.
  • Loading branch information
AvocadoMoon committed Dec 13, 2023
1 parent 6fe7e7d commit fb5cc80
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
5 changes: 4 additions & 1 deletion src/main/java/org/vcell/vcellfiji/N5ImageHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,9 @@ protected ArrayList<String> doInBackground() throws Exception {
protected void done() {
enableCriticalButtons(true);
try{
get();
if(vGui.jFileChooserResult == JFileChooser.APPROVE_OPTION){
get();
}
}
catch (Exception exception){
logService.error(exception);
Expand Down Expand Up @@ -125,6 +127,7 @@ protected void done() {
enableCriticalButtons(true);
try{
get();
vGui.remoteFileSelection.dispose();
}
catch (Exception exception){
logService.error(exception);
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/org/vcell/vcellfiji/UI/N5ViewerGUI.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ public class N5ViewerGUI extends JFrame {
private JPanel datasetListPanel;
private JLabel datasetLabel;
private JLabel openInMemory;
public int jFileChooserResult;

public RemoteFileSelection remoteFileSelection;

Expand Down Expand Up @@ -95,7 +96,7 @@ public N5ViewerGUI() {
@Override
public void actionPerformed(ActionEvent e) {
localFileDialog.setFileSelectionMode(JFileChooser.FILES_AND_DIRECTORIES);
localFileDialog.showOpenDialog(thisJFrame);
jFileChooserResult = localFileDialog.showOpenDialog(thisJFrame);
// System.out.print(localFileDialog.getSelectedFile());
}
});
Expand Down

0 comments on commit fb5cc80

Please sign in to comment.