Index: JEditTextArea.java =================================================================== --- JEditTextArea.java (revision 859) +++ JEditTextArea.java (working copy) @@ -125,9 +125,37 @@ vertical.setValue(vertical.getValue() + amt * 3); } }); + + addShortcuts(); } + + private void addShortcuts() { + InputMap shortCutInputMap = getInputMap(JComponent.WHEN_FOCUSED); + ActionMap shortcutActionMap = getActionMap(); + + shortCutInputMap.put(KeyStroke.getKeyStroke(KeyEvent.VK_DELETE, InputEvent.SHIFT_MASK), "ShiftDelete"); + shortcutActionMap.put("ShiftDelete", new AbstractAction() { + public void actionPerformed(ActionEvent e){ + copy(); + } + }); + shortCutInputMap.put(KeyStroke.getKeyStroke(KeyEvent.VK_INSERT, InputEvent.CTRL_MASK), "CtrlInsert"); + shortcutActionMap.put("CtrlInsert", new AbstractAction() { + public void actionPerformed(ActionEvent e){ + copy(); + } + }); + shortCutInputMap.put(KeyStroke.getKeyStroke(KeyEvent.VK_INSERT, InputEvent.SHIFT_MASK), "ShiftInsert"); + shortcutActionMap.put("ShiftInsert", new AbstractAction() { + public void actionPerformed(ActionEvent e){ + paste(); + } + }); + } + + /** * Get current position of the vertical scroll bar. [fry] */ @@ -1808,7 +1836,7 @@ dim.width += rightPref.width; Dimension bottomPref = bottom.getMinimumSize(); dim.height += bottomPref.height; - + dim.height += 5; return dim;