Forums Register Login

Record Number in JTable

+Pie Number of slices to send: Send
Hi

I am doing the URLyBird assignment.

I will create a Room object that will contain the recNo. My table will then display the Room objects. I have read a thread that talks about the record number in the JTable but am still unsure. Just wondering do you have to create some sort of hidden column in the table containing the record number or is there an alternative approach.

Regards

Rod
+Pie Number of slices to send: Send
Hi Rod,


Read this thread.


HTH,


Carlos.
+Pie Number of slices to send: Send
Hi Carlos,

Thanks for the quick response and the link.

Looks like one way to do it then is to maintain a list of Room objects in the table model which are in the same order as the rooms are displayed in the table. Then the table index of the selected row in the table will allow me to create the Room object from the appropriate list element.

Regards

Rod
+Pie Number of slices to send: Send
Hi Rod,

You don't have to create a Room object when a user selects a row from the table. You just retrieve the Room object from the list in the table model.

Kind regards,
Roel
+Pie Number of slices to send: Send
Hi Roel,

ok. I'm with you now. I'll just grab the Room object from the list.

Many thanks

Rod
What? What, what, what? What what tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 1290 times.
Similar Threads
JTable will not clear
Work with Map in JTable?
Jtable
JTable
Gaps in JTable for deleted records?
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 29, 2024 03:04:46.