aspose file tools*
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes Nx:get the recNo of modify from the AbstractModel Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "Nx:get the recNo of modify from the AbstractModel" Watch "Nx:get the recNo of modify from the AbstractModel" New topic
Author

Nx:get the recNo of modify from the AbstractModel

guyue0505
Greenhorn

Joined: May 25, 2003
Posts: 21
in my project like these:
First i display all records in the JTable of
ClientGui;
Second i constuct the JTable by AbstractModel
my question is :
when i call some methods like deleteRec(..)
and updateRecNo(..),I must get the recNo
modified by the user now;
But how can i found a good way to get the recNo
???
Max Habibi
town drunk
( and author)
Sheriff

Joined: Jun 27, 2002
Posts: 4118
Hi Gy,
Welcome to Javaranch. You had a duplicate post, so I deleted it. Also, please adheare to the 'Ranch naming policy.
Thanks,
M


Java Regular Expressions
Andrew Monkhouse
author and jackaroo
Marshal Commander

Joined: Mar 28, 2003
Posts: 11481
    
  94

Hi Gy
One of the advantages of creating your own table model is that it can store data in formats other than vectors. So you could store the record number as part of the table.
Or, if you are using an MVC design, you could store the record number in the Model, leaving your table with it's abstract table model.
Alternatively, you could do a lookup in the database for the record that you are about to modify - this should return the record number.
I am not suggesting any one of these methods - they all have good points (and at least one I really dislike ). But this should give you something to think about.
Regards, Andrew


The Sun Certified Java Developer Exam with J2SE 5: paper version from Amazon, PDF from Apress, Online reference: Books 24x7 Personal blog
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Nx:get the recNo of modify from the AbstractModel