Skip to content

Commit

Permalink
ArrayOutOfBounds error due to no window listener when editing in the …
Browse files Browse the repository at this point in the history
…search menu. I simply added an empty windowListener.
  • Loading branch information
ThomasShimUoft committed Dec 8, 2022
1 parent 9aee17c commit 01b59e3
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.WindowAdapter;

/**
* The results screen where the user can
Expand Down Expand Up @@ -84,8 +85,10 @@ public SearchResultsScreen(SearchResponseModel responseModel, DBGateway gateway,
}
});
JButton edit = new JButton("Edit");
edit.addActionListener((e) -> new EditorMainScreen(responseModel.getResult_set().get(tempX)
.getFlashcardSetId()));
edit.addActionListener((e) -> {
EditorMainScreen editor = new EditorMainScreen(responseModel.getResult_set().get(tempX).getFlashcardSetId());
editor.addWindowListener(new WindowAdapter() {});
});
JButton delete = new JButton("Delete");
delete.addActionListener(e -> {
DeleteFlashcardSetOutputBoundary presenter = new DeleteFlashcardSetPresenter();
Expand Down

0 comments on commit 01b59e3

Please sign in to comment.