Example usage for javax.swing.text DefaultEditorKit beginAction

List of usage examples for javax.swing.text DefaultEditorKit beginAction

Introduction

In this page you can find the example usage for javax.swing.text DefaultEditorKit beginAction.

Prototype

String beginAction

To view the source code for javax.swing.text DefaultEditorKit beginAction.

Click Source Link

Document

Name of the Action for moving the caret to the beginning of the document.

Usage

From source file:DateTimeEditor.java

protected void setupKeymap() {
    Keymap keymap = m_textField.addKeymap("DateTimeKeymap", null);
    keymap.addActionForKeyStroke(KeyStroke.getKeyStroke(KeyEvent.VK_UP, 0), m_upAction);
    keymap.addActionForKeyStroke(KeyStroke.getKeyStroke(KeyEvent.VK_DOWN, 0), m_downAction);
    keymap.addActionForKeyStroke(KeyStroke.getKeyStroke(KeyEvent.VK_LEFT, 0),
            new BackwardAction(DefaultEditorKit.backwardAction));
    keymap.addActionForKeyStroke(KeyStroke.getKeyStroke(KeyEvent.VK_RIGHT, 0),
            new ForwardAction(DefaultEditorKit.forwardAction));
    keymap.addActionForKeyStroke(KeyStroke.getKeyStroke(KeyEvent.VK_HOME, 0),
            new BeginAction(DefaultEditorKit.beginAction));
    keymap.addActionForKeyStroke(KeyStroke.getKeyStroke(KeyEvent.VK_END, 0),
            new EndAction(DefaultEditorKit.endAction));
    m_textField.setKeymap(keymap);//  w w w  . j a  v a2 s.c o  m
}