Results 1 to 5 of 5

Thread: Trapping keypress in a JTextbox...

  1. #1

    Thread Starter
    I wonder how many charact
    Join Date
    Feb 2001
    Location
    Savage, MN, USA
    Posts
    3,704

    Trapping keypress in a JTextbox...

    I could use some guidance on how to trap the ENTER key in a JTextbox....

    As of now, my customers have to manually click a submit button when done entering the data...

  2. #2

    Thread Starter
    I wonder how many charact
    Join Date
    Feb 2001
    Location
    Savage, MN, USA
    Posts
    3,704
    thanks dilinger, I found some other code too on the Sun Forums...

    basically a one-line statement...
    Code:
    rootPane.setDefaultButton(button1);

  3. #3

  4. #4
    PowerPoster rjlohan's Avatar
    Join Date
    Sep 2001
    Location
    Sydney, Australia
    Posts
    3,205
    Originally posted by nemaroller
    thanks dilinger, I found some other code too on the Sun Forums...

    basically a one-line statement...
    Code:
    rootPane.setDefaultButton(button1);
    Well, technically, that's not catching the keypress event, but if it's what you want, there you go.
    -----------------------------------------
    -RJ
    [email protected]
    -----------------------------------------

  5. #5

Posting Permissions

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



Click Here to Expand Forum to Full Width