cleaning up a little of the esc/ctrl-w code

This commit is contained in:
benfry
2006-03-23 16:19:06 +00:00
parent 344b60c85f
commit b66cc56043
+6 -19
View File
@@ -189,31 +189,18 @@ public class FindReplace extends JFrame implements ActionListener {
setBounds((screen.width - wide) / 2,
(screen.height - high) / 2, wide, high);
// add key listener to trap esc and ctrl/cmd-w
/*
KeyListener listener = new KeyAdapter() {
public void keyPressed(KeyEvent e) {
if (Base.isCloseWindowEvent(e)) hide();
}
};
findField.addKeyListener(listener);
replaceField.addKeyListener(listener);
addKeyListener(listener);
*/
ActionListener disposer = new ActionListener() {
public void actionPerformed(ActionEvent actionEvent) {
//hide();
handleClose();
}
};
setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent e) {
handleClose();
}
});
Base.registerWindowCloseKeys(getRootPane(), disposer);
Base.registerWindowCloseKeys(getRootPane(), new ActionListener() {
public void actionPerformed(ActionEvent actionEvent) {
//hide();
handleClose();
}
});
/*
// hack to to get first field to focus properly on osx