wood burning stoves*
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes Problem with Jtable Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "Problem with Jtable" Watch "Problem with Jtable" New topic
Author

Problem with Jtable

Saraswathy Krishnamoorth
Ranch Hand

Joined: Mar 07, 2003
Posts: 73
I have a Panel which has a JTable and "MakeReservation" button. For JTable the selectionModel is set to ListSelectionModel.SINGLE_SELECTION. The button "MakeReservation" is set as the default button. When the user selectes a row and presses enter, the cursor moves to the next row. Though "MakeReservation" button is set as default button. What should be done to make the makeReservation button be activated when user selects a row and presses enter. Please help. Thanks.
[ April 14, 2003: Message edited by: Saraswathy Krishnamoorth ]
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17249
    
    6

Don't worry about it. When the cursor is in the JTable, The Enter key will function as the JTable will handle it. You can always add a KeyListener to the JTable, but that isn't necessary.
Don't worry that the Enter key won't fire your Button's Action. It won't affect your grade on the assignment.
Mark


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
Saraswathy Krishnamoorth
Ranch Hand

Joined: Mar 07, 2003
Posts: 73
Thanks Mark.
 
wood burning stoves
 
subject: Problem with Jtable
 
Similar Threads
Pressing Enter on JTable, Not jumping to Next Row
problem in colors of cells JTable
Accepting text in JTable
JTable
JTable (Dynamic increase of rows