Changeset 4619 in josm for trunk/src/org


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

fix #7071 - One dialog where Esc doesn't cancel

File:
1 edited

Legend:

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

    r3501 r4619  
    2020import javax.swing.Action;
    2121import javax.swing.BorderFactory;
     22import javax.swing.JComponent;
    2223import javax.swing.JDialog;
    2324import javax.swing.JLabel;
     
    2728import javax.swing.JScrollPane;
    2829import javax.swing.JSplitPane;
     30import javax.swing.KeyStroke;
    2931import javax.swing.ListSelectionModel;
    3032import javax.swing.event.ListSelectionEvent;
     
    262264            putValue(Action.NAME, tr("Cancel"));
    263265            putValue(Action.SMALL_ICON, ImageProvider.get("", "cancel"));
     266            getRootPane().getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW)
     267            .put(KeyStroke.getKeyStroke("ESCAPE"), "ESCAPE");
     268            getRootPane().getActionMap().put("ESCAPE", this);
    264269            setEnabled(true);
    265270        }
Note: See TracChangeset for help on using the changeset viewer.