diff --git a/src/main/java/frameworks_and_drivers/screens/SearchResultsScreen.java b/src/main/java/frameworks_and_drivers/screens/SearchResultsScreen.java index cff8c7c..450dab7 100644 --- a/src/main/java/frameworks_and_drivers/screens/SearchResultsScreen.java +++ b/src/main/java/frameworks_and_drivers/screens/SearchResultsScreen.java @@ -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 @@ -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();