• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

B&S : recNo in My JTable

 
Jiwoong Lee
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • 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.
 
Jared Chapman
Ranch Hand
Posts: 81
  • Mark post as helpful
  • send pies
  • 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.
 
Anton Golovin
Ranch Hand
Posts: 527
  • Mark post as helpful
  • send pies
  • 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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic