Changeset 145

Show
Ignore:
Timestamp:
12/22/09 16:54:41 (2 years ago)
Author:
stefan
Message:

implemented feature #160: settings window should be closed when pressing escape

Location:
trunk
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • trunk/CHANGELOG

    r124 r145  
    33 
    44//== 0.7.3 == 
     5 
     62009-12-22 
     7* [stefan]  * solved issue #158: automate release process 
     8            * added DLLs for Windows i386 and amd64 and Mac OS X i386 
     9            * improved the start scripts (allows a restart of the program, checks OS and architecture) 
     10            * implemented feature #160: settings window should be closed when pressing escape 
    511 
    612== 0.7.2 == 
  • trunk/src/org/jergometer/gui/SettingsWindow.java

    r126 r145  
    326326      } 
    327327    }); 
     328 
     329    // allow closing the dialog with escape 
     330    final KeyStroke keyStroke = KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0, true); 
     331    final ActionListener listener = new ActionListener() { 
     332      public final void actionPerformed(final ActionEvent e) { 
     333        returnCode = ReturnCode.abort; 
     334        setVisible(false); 
     335      } 
     336    }; 
     337    getRootPane().registerKeyboardAction(listener, keyStroke, JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT); 
    328338  } 
    329339