Changeset 4618 in josm for trunk/src/org


Ignore:
Timestamp:
2011-11-29T01:28:10+01:00 (9 years ago)
Author:
Don-vip
Message:

fix #7077 - Another dialog where Esc doesn't cancel

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/io/SaveLayersDialog.java

    r4310 r4618  
    2424import javax.swing.AbstractAction;
    2525import javax.swing.DefaultListCellRenderer;
     26import javax.swing.JComponent;
    2627import javax.swing.JDialog;
    2728import javax.swing.JLabel;
     
    3031import javax.swing.JPanel;
    3132import javax.swing.JScrollPane;
     33import javax.swing.KeyStroke;
    3234import javax.swing.WindowConstants;
    3335
     
    293295            putValue(SHORT_DESCRIPTION, tr("Close this dialog and resume editing in JOSM"));
    294296            putValue(SMALL_ICON, ImageProvider.get("cancel"));
     297            getRootPane().getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW)
     298            .put(KeyStroke.getKeyStroke("ESCAPE"), "ESCAPE");
     299            getRootPane().getActionMap().put("ESCAPE", this);
    295300        }
    296301
Note: See TracChangeset for help on using the changeset viewer.