• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Nx:get the recNo of modify from the AbstractModel

 
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
???
 
town drunk
( and author)
Posts: 4118
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Gy,
Welcome to Javaranch. You had a duplicate post, so I deleted it. Also, please adheare to the 'Ranch naming policy.
Thanks,
M
 
author and jackaroo
Posts: 12200
280
Mac IntelliJ IDE Firefox Browser Oracle C++ Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic