Example usage for javax.swing KeyStroke getKeyStroke

List of usage examples for javax.swing KeyStroke getKeyStroke

Introduction

In this page you can find the example usage for javax.swing KeyStroke getKeyStroke.

Prototype

public static KeyStroke getKeyStroke(int keyCode, int modifiers) 

Source Link

Document

Returns a shared instance of a KeyStroke, given a numeric key code and a set of modifiers.

Usage

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());
}