Example usage for javax.swing JComboBox getInputMap

List of usage examples for javax.swing JComboBox getInputMap

Introduction

In this page you can find the example usage for javax.swing JComboBox getInputMap.

Prototype

public final InputMap getInputMap(int condition) 

Source Link

Document

Returns the InputMap that is used during condition.

Usage

From source file:Main.java

public Main() {
    JComboBox cpmbo = new JComboBox();
    cpmbo.addItem("One");
    cpmbo.addItem("Two");
    cpmbo.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT).put(
            KeyStroke.getKeyStroke(KeyEvent.VK_SPACE, KeyEvent.ALT_DOWN_MASK | KeyEvent.CTRL_DOWN_MASK),
            "spacePopup");

    this.add(cpmbo);
}