This week's book giveaway is in the Mac OS forum.
We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line!
See this thread for details.
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes Question about modify Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "Question about modify" Watch "Question about modify" New topic

Question about modify

Richard Phen
Ranch Hand

Joined: Apr 27, 2002
Posts: 52
Hi, everybody!
I can take the data out from JTable which shows the result search by criteriaFind method. My question is how to use the modify(DataInfo newData) method to book a seat? I mean How to specified the DataInfo's recordNumber? I only can get the values of DataInfo from the JTable.

Robin Underwood
Ranch Hand

Joined: May 01, 2002
Posts: 117
One thing you could do is use a custom table model that extends AbstractTableModel, and holds keys as well as the values (that's what I did). Or you could hold record number as a column in the table model, but not display it in the JTable. Or you could use Data's find() method to retrieve the record that matches the first value (probably not a good way to do it). I'm sure there's plenty more ways besides these...
Richard Phen
Ranch Hand

Joined: Apr 27, 2002
Posts: 52
Thank you for your clearly answer! I got the idea.
GeeCON Prague 2014
subject: Question about modify