aspose file tools*
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes Record Number in JTable Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of JavaScript Promises Essentials this week in the JavaScript forum!
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "Record Number in JTable" Watch "Record Number in JTable" New topic
Author

Record Number in JTable

Rod Sinclair
Greenhorn

Joined: May 11, 2010
Posts: 22
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
Carlos Morillo
Ranch Hand

Joined: Jun 06, 2009
Posts: 221

Hi Rod,


Read this thread.


HTH,


Carlos.


SCSA, OCA, SCJP 5.0, SCJD, CCDH, CCAH http://www.linkedin.com/in/carlosamorillo
Rod Sinclair
Greenhorn

Joined: May 11, 2010
Posts: 22
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
Roel De Nijs
Bartender

Joined: Jul 19, 2004
Posts: 5514
    
  13

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


SCJA, SCJP (1.4 | 5.0 | 6.0), SCJD
http://www.javaroe.be/
Rod Sinclair
Greenhorn

Joined: May 11, 2010
Posts: 22
Hi Roel,

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

Many thanks

Rod
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Record Number in JTable