Examples of InputMap


Examples of javax.swing.InputMap

    contentPane.add(createContentPane(), BorderLayout.CENTER);
    contentPane.add(buttonPanel, BorderLayout.SOUTH);
    setContentPane(contentPane);

    final InputMap inputMap = contentPane.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW);
    final ActionMap actionMap = contentPane.getActionMap();

    inputMap.put(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0), "confirm"); // NON-NLS
    inputMap.put(KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0), "cancel"); // NON-NLS
    actionMap.put("confirm", getConfirmAction()); // NON-NLS
    actionMap.put("cancel", getCancelAction()); // NON-NLS

    resizeDialog();
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.