Menu

#7 Tab key not handled

open
nobody
None
5
2003-07-16
2003-07-16
Anonymous
No

If you press TAB key nothing happens (component loses
focus) - expected behaviour is to insert in document tab
character.

Discussion

  • Anonymous

    Anonymous - 2003-08-22

    Logged In: YES
    user_id=513427

    Hi,

    you could add the following code to the JEditTextArea
    Constructor to set different focus traversal keys. In this
    case the traversal is CTRL+TAB for forward, and
    CTRL+SHIFT+TAB for backward. Pressing only the TAB key will
    insert a tab character:

    # in JEditTextArea(TextAreaDefaults)

    // focus traversal
    Set forward = new TreeSet();
    forward.add(KeyStroke.getKeyStroke(KeyEvent.VK_TAB,InputEvent.CTRL_MASK));
    Set backward = new TreeSet();
    backward.add(KeyStroke.getKeyStroke(KeyEvent.VK_TAB,InputEvent.SHIFT_MASK|InputEvent.CTRL_MASK));

    setFocusTraversalKeys(KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS,forward);
    setFocusTraversalKeys(KeyboardFocusManager.BACKWARD_TRAVERSAL_KEYS,backward);

     
  • Nobody/Anonymous

    Logged In: NO

    This did not work on my editor (using JDK 1.5)

    Is jEdit syntax not being maintained anymore? There seems
    to be next to no activity whatsover?

    James

     

Log in to post a comment.