Results 1 to 9 of 9
  1. #1
    mujibkhan is offline Member
    Join Date
    Apr 2015
    Posts
    2
    Rep Power
    0

    Post how get keypress event for jtable cell.

    while the user type values in jtable cell. I like to get key press or key code values for calculation.

  2. #2
    jim829 is offline Senior Member
    Join Date
    Jan 2013
    Location
    Northern Virginia, United States
    Posts
    6,226
    Rep Power
    13

    Default Re: how get keypress event for jtable cell.

    What have you tried? When I did a web search for "JTables and mouse events" I got quite a few hits.

    Regards,
    Jim
    The JavaTM Tutorials | SSCCE | Java Naming Conventions
    Poor planning on your part does not constitute an emergency on my part

  3. #3
    mujibkhan is offline Member
    Join Date
    Apr 2015
    Posts
    2
    Rep Power
    0

    Default Re: how get keypress event for jtable cell.

    in web I came to know its done by key binding not by keylistener. I tried with mouse listener. But at time i am getting only a single letter.
    I don't know how to handle key binding in jtable.

  4. #4
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    12,059
    Rep Power
    25

    Default Re: how get keypress event for jtable cell.

    Moved from New to Java to AWT/Swing.

    Have you discovered the Oracle tutorials? How to Use Key Bindings (The Java™ Tutorials > Creating a GUI With JFC/Swing > Using Other Swing Features)

    db
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

  5. #5
    gimbal2 is offline Just a guy
    Join Date
    Jun 2013
    Location
    Netherlands
    Posts
    5,114
    Rep Power
    12

    Default Re: how get keypress event for jtable cell.

    Its been a while, but if I remember correctly it was best to use a DocumentListener for this kind of thing, right?

    https://docs.oracle.com/javase/tutor...tlistener.html
    "Syntactic sugar causes cancer of the semicolon." -- Alan Perlis

  6. #6
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    12,059
    Rep Power
    25

    Default Re: how get keypress event for jtable cell.

    Quote Originally Posted by gimbal2 View Post
    Its been a while, but if I remember correctly it was best to use a DocumentListener for this kind of thing, right?
    Depends on what mujibkhan is trying to achieve. And that's not clear to me.

    db
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

  7. #7
    gimbal2 is offline Just a guy
    Join Date
    Jun 2013
    Location
    Netherlands
    Posts
    5,114
    Rep Power
    12

    Default Re: how get keypress event for jtable cell.

    True enough. I zoomed in on the "typing" bit in the original post, but later on I see mentions of mouse listeners which is just confusing.
    "Syntactic sugar causes cancer of the semicolon." -- Alan Perlis

  8. #8
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    12,059
    Rep Power
    25

    Default Re: how get keypress event for jtable cell.

    I was more referring to this:
    key press or key code values for calculation
    What calculation?

    db
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

  9. #9
    jim829 is offline Senior Member
    Join Date
    Jan 2013
    Location
    Northern Virginia, United States
    Posts
    6,226
    Rep Power
    13

    Default Re: how get keypress event for jtable cell.

    Quote Originally Posted by gimbal2 View Post
    True enough. I zoomed in on the "typing" bit in the original post, but later on I see mentions of mouse listeners which is just confusing.
    That was my post. I don't know what I was thinking. I must a have been asleep when I suggested that. It had nothing to do with the OPs question.

    Regards,
    Jim
    The JavaTM Tutorials | SSCCE | Java Naming Conventions
    Poor planning on your part does not constitute an emergency on my part

Similar Threads

  1. KeyPress event controlling wrong component in JFrame
    By StaticFlow in forum AWT / Swing
    Replies: 8
    Last Post: 05-22-2012, 09:29 PM
  2. JTable Cell Color Follow Drag Event
    By joeyvitoro in forum AWT / Swing
    Replies: 6
    Last Post: 11-30-2011, 06:36 PM
  3. Nullifying Keypress or KeyTyped Event
    By tomtraxler in forum New To Java
    Replies: 3
    Last Post: 01-09-2011, 01:19 PM
  4. Identifying sender on keypress event
    By tomtraxler in forum NetBeans
    Replies: 1
    Last Post: 01-08-2011, 04:49 PM
  5. Event after comit the value in cell editor
    By Gajesh Tripathi in forum AWT / Swing
    Replies: 0
    Last Post: 10-16-2008, 07:48 AM

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
  •