List of usage examples for javax.swing KeyStroke getKeyStroke
public static KeyStroke getKeyStroke(int keyCode, int modifiers)
From source file:org.domainmath.gui.MainFrame.java
/** * Set TextArea with octave syntax style. */// w w w. ja v a 2 s . c o m public void setUpArea() { areaFileTab = new RSyntaxTextArea(); areaFileTab.setFont(this.preferencesDlg.getScriptFont()); areaFileTab.setSyntaxEditingStyle(SyntaxConstants.SYNTAX_STYLE_OCTAVE); scroll1 = new RTextScrollPane(areaFileTab); gutterFileTab = scroll1.getGutter(); gutterFileTab.setVisible(true); gutterFileTab.setBookmarkingEnabled(true); urlDebugImageStop = getClass().getResource("resources/stop.png"); gutterFileTab.setBookmarkIcon(new ImageIcon(urlDebugImageStop)); gutterFileTab.setFoldIndicatorEnabled(true); needOct(true); scroll1.setWheelScrollingEnabled(true); KeyStroke key = KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, ActionEvent.CTRL_MASK); areaFileTab.getInputMap().put(key, new CtrlEnterAction()); }