OSDN Git Service

ID入力欄でエンターを押した場合にも適用ボタンを押した場合と同様の動作をさせる
authoryukihane <yukihane.feather@gmail.com>
Wed, 31 Aug 2011 11:10:41 +0000 (20:10 +0900)
committeryukihane <yukihane.feather@gmail.com>
Wed, 31 Aug 2011 11:11:07 +0000 (20:11 +0900)
frontend/src/yukihane/inqubus/gui/MainFrame.java

index 3ef11c5..e639419 100644 (file)
@@ -168,7 +168,8 @@ public class MainFrame extends JFrame {
         setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
 
         btnStop.addActionListener(new StopActionListener());
-        btnApply.addActionListener(new ApplyActionListener());
+        final ApplyActionListener applyListener = new ApplyActionListener();
+        btnApply.addActionListener(applyListener);
 
         pnlMain.setBorder(BorderFactory.createEtchedBorder());
 
@@ -203,6 +204,7 @@ public class MainFrame extends JFrame {
 
         lblId.setText("ID");
 
+        fldId.addActionListener(applyListener);
         fldId.addFocusListener(new java.awt.event.FocusAdapter() {
 
             public void focusLost(java.awt.event.FocusEvent evt) {