Java Swing - O Reilly JTextArea ta = new JTextArea(); ta.setLineWrap(true); return ta; } // Get all of the actions defined for our text component. Hash each one by name // so we can look for it later. protected void hashDefaultActions() { Action[] actions = textComp.getActions(); for (int i=0; iAction mappings protected void updateKeymap() { // Create a new child Keymap Keymap map = JTextComponent.addKeymap(”NextPrevMap”, textComp.getKeymap()); // Define the keystrokes to be added KeyStroke next = KeyStroke.getKeyStroke(KeyEvent.VK_RIGHT, InputEvent.CTRL_MASK, false); KeyStroke prev = KeyStroke.getKeyStroke(KeyEvent.VK_LEFT, InputEvent.CTRL_MASK, false); KeyStroke selNext = KeyStroke.getKeyStroke(KeyEvent.VK_RIGHT, InputEvent.CTRL_MASK|InputEvent.SHIFT_MASK, false); KeyStroke selPrev = KeyStroke.getKeyStroke(KeyEvent.VK_LEFT, InputEvent.CTRL_MASK|InputEvent.SHIFT_MASK, false); // Add the new mappings used DefaultEditorKit actions map.addActionForKeyStroke(next, getHashedAction( DefaultEditorKit.nextWordAction)); map.addActionForKeyStroke(prev, getHashedAction( DefaultEditorKit.previousWordAction)); map.addActionForKeyStroke(selNext, getHashedAction( DefaultEditorKit.selectionNextWordAction)); - 800
We would like to recommend you tested and proved virtual web hosting services, which you will surely find to be of great quality.
This entry was posted
on Saturday, January 12th, 2008 at 11:28 am and is filed under apache.
You can follow any responses to this entry through the RSS 2.0 feed.
You can leave a response, or trackback from your own site.