/**
* Adds particular key accelerators to the editor component.
*/
protected void addBindings(JTextPane editor) {
InputMap inputMap = editor.getInputMap();
//Ctrl-c to copy current selection
KeyStroke key = KeyStroke.getKeyStroke(KeyEvent.VK_C, Event.CTRL_MASK);
inputMap.put(key, DefaultEditorKit.copyAction);
//Ctrl-v to paste clipboard content
key = KeyStroke.getKeyStroke(KeyEvent.VK_V, Event.CTRL_MASK);
inputMap.put(key, DefaultEditorKit.pasteAction);
//Ctrl-x to cut current selection
key = KeyStroke.getKeyStroke(KeyEvent.VK_X, Event.CTRL_MASK);
inputMap.put(key, DefaultEditorKit.cutAction);
}
SimpleTextEditor.java 文件源码
java
阅读 32
收藏 0
点赞 0
评论 0
项目:jGAF
作者:
评论列表
文章目录