• 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:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

B&S : recNo in My JTable

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All.
I am working B&S , but now I am really wondering about How to know the record number if I select any record in my JTable. should i remain renNo also ? plz help me~ Thanks in advance.
 
Ranch Hand
Posts: 81
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Jiwoong,

I am using the record number in my TableModel, but not displaying it on my GUI. This can be accomplished doing something like this:


This will remove the recNo column from the view of the user, but it will still remain in the TableModel.

Hope this helped.
 
Ranch Hand
Posts: 531
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Jiwoong Lee:
Hi All.
I am working B&S , but now I am really wondering about How to know the record number if I select any record in my JTable. should i remain renNo also ? plz help me~ Thanks in advance.



Another method, involving more work, would be to subclass the AbstractTableModel class and include in it a method for converting a JTable line number into the record number from the record. Records could be "shipped" to the table model packaged as a Map where the key is the record number and the value is the record.
reply
    Bookmark Topic Watch Topic
  • New Topic