Results 1 to 2 of 2
  1. #1
    KristoZ is offline Member
    Join Date
    Sep 2009
    Posts
    1
    Rep Power
    0

    Question Tab key in JTextArea

    Hi,

    I would like to know how to select text in a text area by pressing Tab key on the keyboard instead of just getting the Tab char inserted in my text.

    I'm using NetBeans IDE and made a simple interface for my program.
    I've got a menu bar and a text area. I've assigned a keyboard shortcut for the button on a menu bar. When it's set to "Ctrl" + [something] everything works fine, but when I set it to "TAB" it just inserts a tab in my text.

    By pressing a button on the menu bar, the action gets performed.

    How to solve this?

  2. #2
    camickr is offline Senior Member
    Join Date
    Jul 2009
    Posts
    1,233
    Rep Power
    6

    Default

    All text components already have a bunch of select Actions defined by default. They may use different key bindings but you can remap the bindings if you desire. For more information check out:

    tips4java.wordpress.com/2008/10/10/key-bindings/

Similar Threads

  1. About JTEXTAREA
    By makpandian in forum AWT / Swing
    Replies: 4
    Last Post: 03-19-2009, 06:53 AM
  2. JTextArea setting
    By newtojava7 in forum New To Java
    Replies: 1
    Last Post: 01-29-2008, 02:57 AM
  3. How to add a shortcut key from JTextArea
    By sukatoa in forum Advanced Java
    Replies: 2
    Last Post: 01-28-2008, 08:39 AM
  4. JTextArea
    By saytri in forum New To Java
    Replies: 0
    Last Post: 01-13-2008, 01:07 AM
  5. Jtextarea and scroll
    By ziniestro in forum AWT / Swing
    Replies: 2
    Last Post: 06-01-2007, 03:59 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •