Swing, customize the behavior of mnemonic access

Discussion in 'Java' started by subwiz, Sep 18, 2008.

  1. subwiz

    subwiz Guest

    I have a JLabel, which has a mnemonic binding to a JTextField. When I
    access using the mnemonic key-combination, the cursor is placed in the
    JTextField. But I want to override this behavior and make a complete
    selection of the text in the JTextField also. Is this possible?
    subwiz, Sep 18, 2008
    #1
    1. Advertising

  2. In article
    <>,
    subwiz <> wrote:

    > I have a JLabel, which has a mnemonic binding to a JTextField. When I
    > access using the mnemonic key-combination, the cursor is placed in the
    > JTextField. But I want to override this behavior and make a complete
    > selection of the text in the JTextField also. Is this possible?


    See JTextComponent#selectAll(), for example:

    <http://java.sun.com/javase/6/docs/api/javax/swing/text/JTextComponent.html>
    <http://java.sun.com/docs/books/tutorial/uiswing/components/textfield.html>

    --
    John B. Matthews
    trashgod at gmail dot com
    home dot woh dot rr dot com slash jbmatthews
    John B. Matthews, Sep 19, 2008
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. John_Woo
    Replies:
    0
    Views:
    334
    John_Woo
    Jul 14, 2006
  2. Happy Day
    Replies:
    1
    Views:
    403
    Andrew Thompson
    Aug 18, 2007
  3. mnemonic

    , Nov 1, 2007, in forum: C Programming
    Replies:
    83
    Views:
    2,541
    Charlie Gordon
    Nov 7, 2007
  4. jacob navia

    Mnemonic

    jacob navia, Nov 3, 2007, in forum: C Programming
    Replies:
    40
    Views:
    1,501
    Mark McIntyre
    Nov 10, 2007
  5. J Krugman
    Replies:
    2
    Views:
    100
    Ben Morrow
    May 19, 2004
Loading...

Share This Page