Java 8 ComponentInputMap - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Java 8 ComponentInputMap class.

This code example shows how to use the following methods:put
				menuItem.setAccelerator(def.getAccelerator());
			} else { 
				//special logic to support accelerator on JButton (issue 86) 
				if (button instanceof JButton) {
					 
					InputMap keyMap = new ComponentInputMap(button);
					keyMap.put(def.getAccelerator(), "action");
 
					ActionMap actionMap = new ActionMapUIResource();
					actionMap.put("action", new AbstractAction() {
						@Override 
						public void actionPerformed(ActionEvent e) {
							 
							ActionEvent evt = new ActionEvent(button, ActionEvent.ACTION_PERFORMED, "action");
							 
							//fire event listeners 
							if (button.getActionListeners() != null) {
								for(ActionListener listener : button.getActionListeners()) {
									listener.actionPerformed(evt);
								} 
5
CodeRank
See Code Examples for Java 8 ComponentInputMap Methods: