Example usage for javax.swing.text DefaultEditorKit endAction

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

Introduction

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

Prototype

String endAction

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

Click Source Link

Document

Name of the Action for moving the caret to the end 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);/*  www . j  ava2  s .c  om*/
}