Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Populating JTable

 
Saraswathy Krishnamoorth
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have extended AbstractTableModel. In my criteriaFind I return an array of DataInfo objects. In my table model I have schema[] and rowData[][] attributes. I use the DataInfo.getValues() method to populate rowData[][]. If the user selects a row, How will I get the record number which is the unique key. Please help me...
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can get Flight number form the first column, then call the find() method of Data to return the record number.
Mark
 
Saraswathy Krishnamoorth
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
But it has been stated that recordnumber is the unique key.
 
Saraswathy Krishnamoorth
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If flightnumber is also unique...then find method can be used to get recordnumber. But it is not mentioned anywhere that flightnumber is unique. Can we make the assumption that flightnumber is unique.
 
Samual Harvey
Ranch Hand
Posts: 119
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic