本文整理汇总了Java中javax.swing.InputMap.clear方法的典型用法代码示例。如果您正苦于以下问题:Java InputMap.clear方法的具体用法?Java InputMap.clear怎么用?Java InputMap.clear使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javax.swing.InputMap
的用法示例。
在下文中一共展示了InputMap.clear方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: StyleJComboBox
import javax.swing.InputMap; //导入方法依赖的package包/类
/**
* Constructs
*
* @param objPcontrolJFrame
*/
public StyleJComboBox(ControlJFrame objPcontrolJFrame) {
this.objGcontrolJFrame = objPcontrolJFrame;
this.bolGascending = true;
this.setFont(this.objGcontrolJFrame.getFont());
this.setOpaque(true);
this.setToolTipText(this.objGcontrolJFrame.getLanguageString(Language.intS_TOOLTIP_STYLES));
this.setBackground(Constants.objS_PEN_COLORS_LIGHT_YELLOW_COLOR);
this.setMaximumRowCount(Constants.intS_GRAPHICS_MAXIMUM_COMBO_ROWS_NUMBER);
this.addPopupMenuListener(this);
this.addActionListener(this);
final InputMap objLinputMap = this.getInputMap();
final ActionMap objLactionMap = this.getActionMap();
objLinputMap.clear();
objLactionMap.clear();
objLinputMap.put(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0), KeyEvent.VK_ENTER);
objLactionMap.put(KeyEvent.VK_ENTER, new KeysAction(objPcontrolJFrame, KeysAction.bytS_STYLE_J_COMBO_BOX, KeyEvent.VK_ENTER));
objLinputMap.put(KeyStroke.getKeyStroke(KeyEvent.VK_SPACE, 0), KeyEvent.VK_SPACE);
objLactionMap.put(KeyEvent.VK_SPACE, new KeysAction(objPcontrolJFrame, KeysAction.bytS_STYLE_J_COMBO_BOX, KeyEvent.VK_SPACE));
objLinputMap.put(KeyStroke.getKeyStroke(KeyEvent.VK_C, InputEvent.CTRL_MASK), KeyEvent.VK_COPY);
objLactionMap.put(KeyEvent.VK_COPY, new KeysAction(objPcontrolJFrame, KeysAction.bytS_STYLE_J_COMBO_BOX, KeyEvent.VK_COPY));
this.addKeyListener(this);
this.setRenderer(new StylesJComboBoxRenderer(this.objGcontrolJFrame));
this.setTransferHandler(new ExtendedTransferHandler(objPcontrolJFrame, false, true, this.getTransferHandler()));
// setDragEnabled(false);
// setTransferHandler(JuggleTransferHandler(false, true));
// } else {
// setEnabled(false);
// }
}