diff --git a/src/main/java/edu/rpi/legup/ui/proofeditorui/rulesview/RulePanel.java b/src/main/java/edu/rpi/legup/ui/proofeditorui/rulesview/RulePanel.java index f0deab1d6..5db7beeb4 100644 --- a/src/main/java/edu/rpi/legup/ui/proofeditorui/rulesview/RulePanel.java +++ b/src/main/java/edu/rpi/legup/ui/proofeditorui/rulesview/RulePanel.java @@ -8,6 +8,7 @@ import java.awt.*; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; +import java.awt.event.KeyEvent; import java.util.ArrayList; import java.util.List; @@ -204,7 +205,7 @@ public void setSearchBar(Puzzle allPuzzle){ searchBarPanel.add(textField); searchBarPanel.add(Box.createRigidArea(new Dimension(1, 0))); JButton findButton = new JButton("Go"); - findButton.addActionListener(new ActionListener() { + ActionListener action = new ActionListener() { @Override public void actionPerformed(ActionEvent event) { if (ruleButtons != null) { @@ -234,7 +235,9 @@ public void actionPerformed(ActionEvent event) { } } - }); + }; + textField.addActionListener(action); + findButton.addActionListener(action); searchBarPanel.add(findButton); }